Package org.eclipse.core.filesystem

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


    if (path == null)
      return;

    IFileStore fileStore= EFS.getLocalFileSystem().getStore(new Path(path));
    IFileInfo fileInfo= fileStore.fetchInfo();

    if (fileInfo.getAttribute(EFS.ATTRIBUTE_HIDDEN)) {
      String title= TextEditorTemplateMessages.TemplatePreferencePage_export_error_title;
      String message= NLSUtility.format(TextEditorTemplateMessages.TemplatePreferencePage_export_error_hidden, fileStore.toString());
      MessageDialog.openError(getShell(), title, message);
View Full Code Here


    return NLS.bind(XMLUIMessages.Open, path);
  }

  private String getEditorLabel() {
    final IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
    final String name = store.fetchInfo().getName();

    if (name == null) {
      return null;
    }
View Full Code Here

            StringBuffer notFound = new StringBuffer();
            IWorkbenchPage page = window.getActivePage();
            for ( String name : names )
            {
                IFileStore fileStore = EFS.getLocalFileSystem().getStore( new Path( filterPath ) ).getChild( name );
                IFileInfo fetchInfo = fileStore.fetchInfo();
                if ( !fetchInfo.isDirectory() && fetchInfo.exists() )
                {
                    try
                    {
                        IDE.openEditorOnFileStore( page, fileStore );
View Full Code Here

            StringBuffer notFound = new StringBuffer();
            IWorkbenchPage page = window.getActivePage();
            for ( String name : names )
            {
                IFileStore fileStore = EFS.getLocalFileSystem().getStore( new Path( filterPath ) ).getChild( name );
                IFileInfo fetchInfo = fileStore.fetchInfo();
                if ( !fetchInfo.isDirectory() && fetchInfo.exists() )
                {
                    try
                    {
                        IDE.openEditorOnFileStore( page, fileStore );
View Full Code Here

  }

  // see org.eclipse.orion.internal.server.servlets.workspace.WorkspaceResourceHandler.generateProjectLocation(WebProject, String)
  private static IFileStore getProjectStore(ProjectInfo project, String user) throws CoreException {
    IFileStore projectStore = OrionConfiguration.getMetaStore().getDefaultContentLocation(project);
    if (!projectStore.fetchInfo().exists()) {
      projectStore.mkdir(EFS.NONE, null);
    }
    return projectStore;
  }
View Full Code Here

      // FIXME: this code is copied from NewFileServlet, fix it
      // start copied
      String pathInfo = path.toString();
      IPath filePath = pathInfo == null ? Path.ROOT : new Path(pathInfo);
      IFileStore file = tempGetFileStore(filePath);
      if (file == null || !file.fetchInfo().exists()) {
        if (failEarlyOn404) {
          return false;
        }
        handleException(resp, new ServerStatus(IStatus.ERROR, 404, NLS.bind("File not found: {0}", filePath), null));
        return true;
View Full Code Here

      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, "File name not specified.", null));
    IFileStore toCreate = dir.getChild(name);
    if (!name.equals(toCreate.getName()) || name.contains(":"))
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, "Bad file name: " + name, null));
    int options = getCreateOptions(request);
    boolean destinationExists = toCreate.fetchInfo(EFS.NONE, null).exists();
    if (!validateOptions(request, response, toCreate, destinationExists, options))
      return true;
    //perform the operation
    if (performPost(request, response, requestObject, toCreate, options)) {
      //write the response
View Full Code Here

      return true;
    //perform the operation
    if (performPost(request, response, requestObject, toCreate, options)) {
      //write the response
      URI location = URIUtil.append(getURI(request), name);
      JSONObject result = ServletFileStoreHandler.toJSON(toCreate, toCreate.fetchInfo(EFS.NONE, null), location);
      result.append("FileEncoding", System.getProperty("file.encoding"));
      OrionServlet.writeJSONResponse(request, response, result);
      response.setHeader(ProtocolConstants.HEADER_LOCATION, ServletResourceHandler.resovleOrionURI(request, location).toString());
      //response code should indicate if a new resource was actually created or not
      response.setStatus(destinationExists ? HttpServletResponse.SC_OK : HttpServletResponse.SC_CREATED);
View Full Code Here

            // The folder is a project, remove the metadata
            OrionConfiguration.getMetaStore().deleteProject(path.segment(1), source.getName());
          }
        }
      } catch (CoreException e) {
        if (!source.fetchInfo(EFS.NONE, null).exists()) {
          statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, NLS.bind("Source does not exist: ", locationString), e));
          return false;
        }
        if (e.getStatus().getCode() == EFS.ERROR_EXISTS) {
          statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_PRECONDITION_FAILED, "A file or folder with the same name already exists at this location", null));
View Full Code Here

      return;
    }
    IFileStore file = getFileStore(req, path);
    IFileStore testLink = file;
    while (testLink != null) {
      IFileInfo info = testLink.fetchInfo();
      if (info.getAttribute(EFS.ATTRIBUTE_SYMLINK)) {
        if (file == testLink) {
          handleException(resp, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_FORBIDDEN, NLS.bind("Forbidden: {0}", EncodingUtils.encodeForHTML(pathInfo.toString())), null));
        } else {
          handleException(resp, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, NLS.bind("File not found: {0}", EncodingUtils.encodeForHTML(pathInfo.toString())), null));
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.