Package org.eclipse.core.filesystem

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


  @Override
  public File getDeploymentPackage(IFileStore contentLocation) throws IOException, CoreException {

    /* require a package.json file present */
    IFileStore packageStore = contentLocation.getChild(NodeJSConstants.PACKAGE_JSON);
    if (!packageStore.fetchInfo().exists())
      return null;

    InputStream is = null;
    JSONObject packageJSON = null;

View Full Code Here


  @Override
  public Plan getDeploymentPlan(IFileStore contentLocation, ManifestParseTree manifest) {

    /* a present package.json file determines a node.js application */
    IFileStore packageStore = contentLocation.getChild(NodeJSConstants.PACKAGE_JSON);
    if (!packageStore.fetchInfo().exists())
      return null;

    /* do not support multi-aplication manifests */
    if (manifest != null && ManifestUtils.hasMultipleApplications(manifest))
      return null;
View Full Code Here

        IOUtilities.safeClose(is);
      }

      /* look for server.js or app.js files */
      IFileStore serverJS = contentLocation.getChild(NodeJSConstants.SERVER_JS);
      if (serverJS.fetchInfo().exists()) {
        application.put(ManifestConstants.COMMAND, NodeJSConstants.NODE_SERVER_JS);
        return new Plan(getId(), getWizardId(), TYPE, manifest);
      }

      IFileStore appJS = contentLocation.getChild(NodeJSConstants.APP_JS);
View Full Code Here

        application.put(ManifestConstants.COMMAND, NodeJSConstants.NODE_SERVER_JS);
        return new Plan(getId(), getWizardId(), TYPE, manifest);
      }

      IFileStore appJS = contentLocation.getChild(NodeJSConstants.APP_JS);
      if (appJS.fetchInfo().exists()) {
        application.put(ManifestConstants.COMMAND, NodeJSConstants.NODE_APP_JS);
        return new Plan(getId(), getWizardId(), TYPE, manifest);
      }

      /* could not deduce command, mark as required */
 
View Full Code Here

      String workspaceId = workspaceIds.get(0);

      // see if the .bashrc already exists
      IFileStore workspaceContentLocation = metaStore.getWorkspaceContentLocation(workspaceId);
      IFileStore bashrc = workspaceContentLocation.getChild(".bashrc");
      if (bashrc.fetchInfo().exists()) {
        // .bashrc already exists, return
        return;
      }

      // copy the default bashrc if one exists on this system
View Full Code Here

      }

      // copy the default bashrc if one exists on this system
      File skelFile = new File("/etc/skel/.bashrc");
      IFileStore skel = EFS.getLocalFileSystem().fromLocalFile(skelFile);
      if (skel.fetchInfo().exists()) {
        skel.copy(bashrc, EFS.NONE, null);
      }
      File bashrcFile = bashrc.toLocalFile(EFS.NONE, null);

      // append lines to the bashrc
View Full Code Here

          IPath contentPath = new Path(path.startsWith("/") ? path : "/" + path); //$NON-NLS-1$ //$NON-NLS-2$
          if (!AuthorizationService.checkRights(userId, contentPath.toString(), "GET")) //$NON-NLS-1$ //$NON-NLS-2$
            return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_FORBIDDEN, "Forbidden access to application contents", null);

          IFileStore contentLocation = NewFileServlet.getFileStore(null, contentPath.removeFirstSegments(1));
          if (!contentLocation.fetchInfo().isDirectory())
            contentLocation = contentLocation.getParent();

          /* check if the application has a manifest */
          ManifestParseTree manifest = null;
          ParseManifestCommand parseManifestCommand = new ParseManifestCommand(null, userId, contentPath.toString()); /* TODO: set target */
 
View Full Code Here

    IPath destPath = new Path(getPath()).append(getFileName());
    try {
      IFileStore source = EFS.getStore(new File(getStorageDirectory(), FILE_DATA).toURI());
      IFileStore destination = NewFileServlet.getFileStore(req, destPath);
      if (!override && destination.fetchInfo().exists()) {
        String msg = NLS.bind("Failed to complete file transfer on {0}. The file could not be overwritten.", destPath.toString());
        JSONObject jsonData = new JSONObject();
        jsonData.put("ExistingFiles", getFileName());
        statusHandler.handleRequest(req, resp, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, jsonData, null));
        return false;
View Full Code Here

    }

    /* exclude .git if already present in the destination root, see bug 428657 */
    IFileStore destinationRoot = NewFileServlet.getFileStore(req, destPath);
    IFileStore dotGitStorage = destinationRoot.getChild(".git"); //$NON-NLS-1$
    if (dotGitStorage.fetchInfo().exists())
      excludedFiles.add(".git"); //$NON-NLS-1$

    try {
      ZipFile source = new ZipFile(new File(getStorageDirectory(), FILE_DATA));

View Full Code Here

          continue;
        }
        if (entry.isDirectory())
          destination.mkdir(EFS.NONE, null);
        else {
          if (!force && destination.fetchInfo().exists()) {
            filesFailed.add(entry.getName());
            continue;
          }
          destination.getParent().mkdir(EFS.NONE, null);
          // this filter will throw an IOException if a zip entry is larger than 100MB
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.