Package org.eclipse.core.filesystem

Examples of org.eclipse.core.filesystem.IFileStore.fetchInfo()


      ServerStatus accessStatus = canAccess(contentPath);
      if (!accessStatus.isOK())
        return accessStatus;

      IFileStore fileStore = NewFileServlet.getFileStore(null, contentPath);
      if (!fileStore.fetchInfo().isDirectory()) {
        fileStore = fileStore.getParent();
        contentPath = contentPath.removeLastSegments(1);
      }

      if (fileStore == null)
View Full Code Here


      if (fileStore == null)
        return cannotFindManifest(contentPath);

      /* lookup the manifest description */
      IFileStore manifestStore = fileStore.getChild(ManifestConstants.MANIFEST_FILE_NAME);
      if (!manifestStore.fetchInfo().exists())
        return cannotFindManifest(contentPath);

      /* parse within the project sandbox */
      ProjectInfo project = OrionConfiguration.getMetaStore().readProject(contentPath.segment(0), contentPath.segment(1));
      IFileStore projectStore = NewFileServlet.getFileStore(null, project);
View Full Code Here

      ServerStatus accessStatus = canAccess(contentPath);
      if (!accessStatus.isOK())
        return accessStatus;

      IFileStore fileStore = NewFileServlet.getFileStore(null, contentPath);
      if (!fileStore.fetchInfo().isDirectory()) {
        fileStore = fileStore.getParent();
        contentPath = contentPath.removeLastSegments(1);
      }

      /* parse the manifest */
 
View Full Code Here

          file = EFS.getLocalFileSystem().getStore(URIUtil.toPath(uri));
        } else {
          file = EFS.getStore(uri);
        }

        if (!file.fetchInfo().exists())
          listIds.add((String) doc.getFieldValue(ProtocolConstants.KEY_ID));

      } catch (Exception e) {
        handleIndexingFailure(e);
        continue;
View Full Code Here

   * Generates a file system location for newly created project. Creates a new
   * folder in the file system and ensures it is empty.
   */
  private static URI generateProjectLocation(ProjectInfo project, String user) throws CoreException {
    IFileStore projectStore = OrionConfiguration.getMetaStore().getDefaultContentLocation(project);
    if (projectStore.fetchInfo().exists()) {
      //This folder must be empty initially or we risk showing another user's old private data
      projectStore.delete(EFS.NONE, null);
    }
    projectStore.mkdir(EFS.NONE, null);
    return projectStore.toURI();
View Full Code Here

        //this is the location of the project file contents
        URI contentLocation = computeProjectURI(baseLocation, workspace, project);
        child.put(ProtocolConstants.KEY_LOCATION, contentLocation);
        try {
          if (projectStore != null)
            child.put(ProtocolConstants.KEY_LOCAL_TIMESTAMP, projectStore.fetchInfo(EFS.NONE, null).getLastModified());
        } catch (CoreException coreException) {
          //just omit the timestamp in this case because the project location is unreachable
        }
        try {
          child.put(ProtocolConstants.KEY_CHILDREN_LOCATION, new URI(contentLocation.getScheme(), contentLocation.getUserInfo(), contentLocation.getHost(), contentLocation.getPort(), contentLocation.getPath(), ProtocolConstants.PARM_DEPTH + "=1", contentLocation.getFragment())); //$NON-NLS-1$
View Full Code Here

    testProjectLocalFileLocation = "/" + project.optString(ProtocolConstants.KEY_ID, null);
  }

  protected boolean checkDirectoryExists(String path) throws CoreException {
    IFileStore dir = EFS.getStore(makeLocalPathAbsolute(path));
    return (dir.fetchInfo().exists() && dir.fetchInfo().isDirectory());
  }

  protected boolean checkFileExists(String path) throws CoreException {
    IFileStore file = EFS.getStore(makeLocalPathAbsolute(path));
    return (file.fetchInfo().exists() && !file.fetchInfo().isDirectory());
View Full Code Here

    testProjectLocalFileLocation = "/" + project.optString(ProtocolConstants.KEY_ID, null);
  }

  protected boolean checkDirectoryExists(String path) throws CoreException {
    IFileStore dir = EFS.getStore(makeLocalPathAbsolute(path));
    return (dir.fetchInfo().exists() && dir.fetchInfo().isDirectory());
  }

  protected boolean checkFileExists(String path) throws CoreException {
    IFileStore file = EFS.getStore(makeLocalPathAbsolute(path));
    return (file.fetchInfo().exists() && !file.fetchInfo().isDirectory());
View Full Code Here

    return (dir.fetchInfo().exists() && dir.fetchInfo().isDirectory());
  }

  protected boolean checkFileExists(String path) throws CoreException {
    IFileStore file = EFS.getStore(makeLocalPathAbsolute(path));
    return (file.fetchInfo().exists() && !file.fetchInfo().isDirectory());
  }

  protected boolean checkContentEquals(File expected, String actual) throws IOException, CoreException {
    File actualContent = EFS.getStore(makeLocalPathAbsolute(actual)).toLocalFile(EFS.NONE, null);
    return FileUtils.contentEquals(expected, actualContent);
View Full Code Here

    return (dir.fetchInfo().exists() && dir.fetchInfo().isDirectory());
  }

  protected boolean checkFileExists(String path) throws CoreException {
    IFileStore file = EFS.getStore(makeLocalPathAbsolute(path));
    return (file.fetchInfo().exists() && !file.fetchInfo().isDirectory());
  }

  protected boolean checkContentEquals(File expected, String actual) throws IOException, CoreException {
    File actualContent = EFS.getStore(makeLocalPathAbsolute(actual)).toLocalFile(EFS.NONE, null);
    return FileUtils.contentEquals(expected, actualContent);
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.