Examples of LocalFile


Examples of gri.tasks.remote.files.LocalFile

      throw new RuntimeException("Cannot set value of GridpInputFileWidget");
    }
    public Object getValue() {
      File file = super.getFile();
      return new LocalFile(file);
    }
View Full Code Here

Examples of gri.tasks.remote.files.LocalFile

    public Object read(Element elem) throws IOException {
  return readFile(elem);
    }
   
    public void writeFile(File file, Element elem) throws IOException {
  LocalFile tFile = (file == null) ?
    null : new LocalFile(file);
  serializer.write(tFile, elem);
    }
View Full Code Here

Examples of gri.tasks.remote.files.LocalFile

  //path:
  Element pathElem = elem.getChild("path");
  if (pathElem == null)
      throw new IOException("Invalid LocalFile: Missing required 'path' element");
 
  LocalFile file = new LocalFile(pathElem.getText());
 
  //name:
  Element nameElem = elem.getChild("name");
  if (nameElem != null)
      file.setName(nameElem.getText());
 
  return file;
    }
View Full Code Here

Examples of org.apache.commons.vfs.provider.local.LocalFile

      sb.append(System.getProperty("user.home"));
      sb.append("/.docx4j/tmp/");
      sb.append(fo.getName().getBaseName());
      String tmpPath = sb.toString().replace('\\', '/');
     
      LocalFile localCopy = null;
      try {
        localCopy = (LocalFile) VFS.getManager().resolveFile(tmpPath);
        localCopy.copyFrom(fo, new FileTypeSelector(FileType.FILE));
        localCopy.close();
       
        thePackage = getPackageFromLocalFile(localCopy);
      } catch (FileSystemException exc) {
        exc.printStackTrace();
        throw new Docx4JException("Could not create a temporary local copy", exc);
      } finally {
        if (localCopy != null) {
          try {
            localCopy.delete();
          } catch (FileSystemException exc) {
            exc.printStackTrace();
            log.warn("Couldn't delete temporary file " + tmpPath);
          }
        }
View Full Code Here

Examples of org.apache.commons.vfs.provider.local.LocalFile

   * @throws Exception
   */
  public static WordprocessingMLPackage convert(
      org.apache.commons.vfs.FileObject in) throws Exception {

    LocalFile localCopy = null;
    if (!(in instanceof LocalFile)) {

      StringBuffer sb = new StringBuffer("file:///");
      sb.append(System.getProperty("user.home"));
      sb.append("/.docx4j/tmp/");
      sb.append(in.getName().getBaseName());
      String tmpPath = sb.toString().replace('\\', '/');

      try {
        localCopy = (LocalFile) VFS.getManager().resolveFile(tmpPath);
        localCopy.copyFrom(in, new FileTypeSelector(FileType.FILE));
        localCopy.close();
      } catch (FileSystemException exc) {
        exc.printStackTrace();
        throw new Docx4JException(
            "Could not create a temporary local copy", exc);
      } finally {
        if (localCopy != null) {
          try {
            localCopy.delete();
          } catch (FileSystemException exc) {
            exc.printStackTrace();
            log.warn("Couldn't delete temporary file " + tmpPath);
          }
        }
View Full Code Here

Examples of org.eclipse.core.internal.filesystem.local.LocalFile

        result = getUniqueDirectory(cacheDir, false);
      } else {
        result = File.createTempFile(source.getFileSystem().getScheme(), "efs", cacheDir); //$NON-NLS-1$
      }
      monitor.worked(25);
      IFileStore resultStore = new LocalFile(result);
      source.copy(resultStore, EFS.OVERWRITE, Policy.subMonitorFor(monitor, 25));
      result.deleteOnExit();
      return result;
    } catch (IOException e) {
      Policy.error(EFS.ERROR_WRITE, NLS.bind(Messages.couldNotWrite, toString()));
View Full Code Here

Examples of org.eclipse.core.internal.filesystem.local.LocalFile

   * Performs initial cleanup of any old cached state left over from previous
   * sessions.
   */
  private void cleanOldCache(File cacheParent) throws CoreException {
    //clear any old cache - this could be moved to a background thread
    new LocalFile(cacheParent).delete(EFS.NONE, null);
  }
View Full Code Here

Examples of org.eclipse.core.internal.filesystem.local.LocalFile

      String randomName = UUID.randomUUID().toString();
      tmp = File.createTempFile(randomName, ".zip"); //$NON-NLS-1$

      /* check whether the application store is a war file */
      if (applicationStore.getName().endsWith(".war")) { //$NON-NLS-1$
        applicationStore.copy(new LocalFile(tmp), EFS.OVERWRITE, null);
        return tmp;
      }

      /* check whether the application store contains a war file */
      for (IFileStore child : applicationStore.childStores(EFS.NONE, null)) {
        if (child.getName().endsWith(".war")) { //$NON-NLS-1$
          child.copy(new LocalFile(tmp), EFS.OVERWRITE, null);
          return tmp;
        }
      }

      /* war is not the answer, zip application contents */
 
View Full Code Here

Examples of org.eclipse.jgit.util.TemporaryBuffer.LocalFile

  }

  public void setFixedLengthStreamingMode(int contentLength) {
    if (entity != null)
      throw new IllegalArgumentException();
    entity = new TemporaryBufferEntity(new LocalFile());
    entity.setContentLength(contentLength);
  }
View Full Code Here

Examples of org.eclipse.jgit.util.TemporaryBuffer.LocalFile

    entity.setContentLength(contentLength);
  }

  public OutputStream getOutputStream() throws IOException {
    if (entity == null)
      entity = new TemporaryBufferEntity(new LocalFile());
    return entity.getBuffer();
  }
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.