Examples of File


Examples of com.github.api.v2.schema.File

    String apiUrl = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
    Gist gist = new Gist();
    gist.setDescription(description);
    gist.setVisibility(visibility);
    for (String filename : contents.keySet()) {
      File file = new File();
      file.setFilename(filename);
      file.setContent(contents.get(filename));
     
      gist.getFiles().put(filename, file);
    }
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(gist), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 201));
        return unmarshall(new TypeToken<Gist>(){}, json);
View Full Code Here

Examples of com.github.hakko.musiccabinet.domain.model.library.File

public class UnittestLibraryUtil {

  private static int counter = 0;
 
  public static File getFile() {
    File file = new File("/unittest", "/unittest/file" + counter++ + ".ogg", new DateTime(), 0);
    MetaData md = new MetaData();
    md.setArtist("Unittest Artist");
    md.setAlbum("Unittest Album " + counter);
    md.setTitle("Unittest Title " + counter);
    md.setBitrate((short) 144);
    md.setVbr(false);
    md.setDuration((short) 90);
    md.setYear((short) 1900);
    md.setMediaType(Mediatype.OGG);
    file.setMetaData(md);
    return file;
  }
View Full Code Here

Examples of com.google.api.services.drive.model.File

        if (Logging.connectors.isDebugEnabled()) {
          Logging.connectors.debug("GOOGLEDRIVE: Processing document identifier '"
              + nodeId + "'");
        }

        File googleFile = getObject(nodeId);
        if (googleFile == null || (googleFile.containsKey("explicitlyTrashed") && googleFile.getExplicitlyTrashed())) {
          //its deleted, move on
          continue;
        }


        if (Logging.connectors.isDebugEnabled()) {
          Logging.connectors.debug("GOOGLEDRIVE: have this file:\t" + googleFile.getTitle());
        }

        if ("application/vnd.google-apps.folder".equals(googleFile.getMimeType())) {
          //if directory add its children

          if (Logging.connectors.isDebugEnabled()) {
            Logging.connectors.debug("GOOGLEDRIVE: its a directory");
          }

          // adding all the children + subdirs for a folder

          getSession();
          GetChildrenThread t = new GetChildrenThread(nodeId);
          try {
            t.start();
            boolean wasInterrupted = false;
            try {
              XThreadStringBuffer childBuffer = t.getBuffer();
              // Pick up the paths, and add them to the activities, before we join with the child thread.
              while (true) {
                // The only kind of exceptions this can throw are going to shut the process down.
                String child = childBuffer.fetch();
                if (child ==  null)
                  break;
                // Add the pageID to the queue
                activities.addDocumentReference(child, nodeId, RELATIONSHIP_CHILD);
              }
            } catch (InterruptedException e) {
              wasInterrupted = true;
              throw e;
            } catch (ManifoldCFException e) {
              if (e.getErrorCode() == ManifoldCFException.INTERRUPTED)
                wasInterrupted = true;
              throw e;
            } finally {
              if (!wasInterrupted)
                t.finishUp();
            }
          } catch (InterruptedException e) {
            t.interrupt();
            throw new ManifoldCFException("Interrupted: " + e.getMessage(), e,
              ManifoldCFException.INTERRUPTED);
          } catch (java.net.SocketTimeoutException e) {
            Logging.connectors.warn("GOOGLEDRIVE: Socket timeout adding child documents: " + e.getMessage(), e);
            handleIOException(e);
          } catch (InterruptedIOException e) {
            t.interrupt();
            throw new ManifoldCFException("Interrupted: " + e.getMessage(), e,
              ManifoldCFException.INTERRUPTED);
          } catch (IOException e) {
            Logging.connectors.warn("GOOGLEDRIVE: Error adding child documents: " + e.getMessage(), e);
            handleIOException(e);
          }

        } else {
          // its a file
          if (!scanOnly[i]) {
            doLog = true;

            if (Logging.connectors.isDebugEnabled()) {
              Logging.connectors.debug("GOOGLEDRIVE: its a file");
            }

            // We always direct to the PDF
            String documentURI = getUrl(googleFile, "application/pdf");

            // Get the file length
            Long fileLength = googleFile.getFileSize();
            if (fileLength != null) {

              // Unpack the version string
              ArrayList acls = new ArrayList();
              StringBuilder denyAclBuffer = new StringBuilder();
              int index = unpackList(acls,version,0,'+');
              if (index < version.length() && version.charAt(index++) == '+') {
                index = unpack(denyAclBuffer,version,index,'+');
              }

              //otherwise process
              RepositoryDocument rd = new RepositoryDocument();

              // Turn into acls and add into description
              String[] aclArray = new String[acls.size()];
              for (int j = 0; j < aclArray.length; j++) {
                aclArray[j] = (String)acls.get(j);
              }
              rd.setACL(aclArray);
              if (denyAclBuffer.length() > 0) {
                String[] denyAclArray = new String[]{denyAclBuffer.toString()};
                rd.setDenyACL(denyAclArray);
              }

              // Now do standard stuff
              String mimeType = googleFile.getMimeType();
              DateTime createdDate = googleFile.getCreatedDate();
              DateTime modifiedDate = googleFile.getModifiedDate();
              String extension = googleFile.getFileExtension();
              String title = googleFile.getTitle();
             
              if (mimeType != null)
                rd.setMimeType(mimeType);
              if (createdDate != null)
                rd.setCreatedDate(new Date(createdDate.getValue()));
              if (modifiedDate != null)
                rd.setModifiedDate(new Date(modifiedDate.getValue()));
              if (extension != null)
              {
                if (title == null)
                  title = "";
                rd.setFileName(title + "." + extension);
              }

              // Get general document metadata
              for (Entry<String, Object> entry : googleFile.entrySet()) {
                rd.addField(entry.getKey(), entry.getValue().toString());
              }

              // Fire up the document reading thread
              DocumentReadingThread t = new DocumentReadingThread(documentURI);
View Full Code Here

Examples of com.google.gwt.gears.client.desktop.File

            /* (non-Javadoc)
             * @see com.google.gwt.gears.client.desktop.OpenFilesHandler#onOpenFiles(com.google.gwt.gears.client.desktop.OpenFilesHandler.OpenFilesEvent)
             */
            public void onOpenFiles(OpenFilesEvent event){
              File[] files = event.getFiles();
              File file = files[0];
              Blob data = file.getBlob();
              BlobReader reader = new BlobReader(data);
              String map = "";
              while(!reader.endOfBlob())
                map = map + reader.readLine() + "\n";
              Home.webError(map);
View Full Code Here

Examples of com.hamburgsud.log4testing.core.output.util.File

public class HTMLTestCaseWriter extends HTMLWriter<TestCase> {

  public void write(final TestCase testCase) {
    try {
      final File file = new File(this);
      file.writeAttachments(testCase);
      final Velocity velocity = new Velocity(this);
      final String content = velocity.merge(testCase);
      file.write(testCase, content);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.File

    FileServiceApp fsa = null;
    try {
      fsa = new FileServiceApp(url, user, password);
     
      FileService fileService = fsa.getFileService();
      File file = fileService.getFile("087ad154-df65-43c2-8c4e-383c68337724", "6097b4ce-39dc-4db1-9d4f-4d89ff125c69", null);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      long size = fileService.downloadFile(baos, file, null);
     
      System.out.println(DOMUtil.getXMLString(file.getDataHandler().getData()));
      System.out.println("Downloaded: "+size);
     
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of com.jverrecchia.initializr.builder.files.File

 
  public Boilerplate(){
    this.setName("Boilerplate Custom");
    this.setId("h5bp");
    this.setFileName("h5bp-initializr");
    this.getFiles().add(new File("index.html", "builder/templates/index.html", true, true));
    this.getFiles().add(new File("css/main.css", "builder/templates/main.css", true, true));
    this.getDefaultModulesNames().add("h5bp-content");
    this.getDefaultModulesNames().add("h5bp-stylefile");
    this.getDefaultModulesNames().add("h5bp-css");
    this.getDefaultModulesNames().add("h5bp-primarystyles");
    this.getDefaultModulesNames().add("h5bp-csshelpers");
View Full Code Here

Examples of com.sissi.protocol.iq.si.File

   *
   * @see com.sissi.persistent.PersistentElement#read(java.util.Map)
   */
  @Override
  public Element read(Map<String, Object> element) {
    return IQ.class.cast(super.read(element, new IQ())).setId(element.get(Dictionary.FIELD_SID).toString()).setFrom(this.delegation).add(new Si().setId(element.get(Dictionary.FIELD_SID).toString()).setSource(element.get(Dictionary.FIELD_FROM).toString()).setProfile(this.profile).setFeature(this.feature).setFile(new File().setName(element.get(Dictionary.FIELD_NAME).toString()).setSize(element.get(Dictionary.FIELD_SIZE).toString())).delay(super.toString(element, Dictionary.FIELD_DELAY)));
  }
View Full Code Here

Examples of com.starbase.starteam.File

            // For all Files in this folder, we need to check
            // if there have been modifications.

            for (int i = 0; i < files.length; i++) {
                File eachFile = (File) files[i];
                String filename = eachFile.getName();
                java.io.File localFile =
                        new java.io.File(targetFolder, filename);

                ufm.removeControlledItem(localFile);
View Full Code Here

Examples of com.sun.akuma.CLibrary.FILE

            if (areWe64) {
                // 32bit and 64bit basically does the same thing, but because the stream position
                // is computed with signed long, doing 64bit seek to a position bigger than Long.MAX_VALUE
                // requres some real hacking. Hence two different code path.
                // (RandomAccessFile uses Java long for offset, so it just can't get to anywhere beyond Long.MAX_VALUE)
                FILE fp = LIBC.fopen(asFile.getPath(),"r");
                try {
                    JavaVMArguments args = new JavaVMArguments();
                    Memory m = new Memory(8);
                    for( int n=0; n<argc; n++ ) {
                        // read a pointer to one entry
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.