Examples of IFileStore


Examples of org.eclipse.core.filesystem.IFileStore

   * Converts the given URI to a local file. Use the existing file if the uri is on the local file system.
   * Otherwise fetch it.
   * Returns null if unable to fetch it.
   */
  public static File toLocalFile(URI uri, IProgressMonitor monitor) throws CoreException {
    IFileStore fileStore = EFS.getStore(uri);
    File localFile = fileStore.toLocalFile(EFS.NONE, monitor);
    if (localFile ==null)
      // non local file system
      localFile= fileStore.toLocalFile(EFS.CACHE, monitor);
    return localFile;
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

                    if (element instanceof IAdaptable) {
                        URI uri = (URI) ((IAdaptable) element).getAdapter(URI.class);
                        if (uri != null) {
                            IWorkbenchPage page = getSite().getPage();
                            try {
                                IFileStore fileStore = EFS.getLocalFileSystem().getStore(uri);
                                IDE.openEditorOnFileStore(page, fileStore);
                            } catch (PartInitException e) {
                                logger.logError("Error opening editor for " + uri, e);
                            }
                        }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    display.asyncExec(new Runnable() {
      public void run() {
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (window == null)
          return;
        IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(path));
        IFileInfo fetchInfo = fileStore.fetchInfo();
        if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
          IWorkbenchPage page = window.getActivePage();
          if (page == null) {
            String msg = NLS.bind(IDEWorkbenchMessages.OpenDelayedFileAction_message_noWindow, path);
            MessageDialog.open(MessageDialog.ERROR, window.getShell(),
                IDEWorkbenchMessages.OpenDelayedFileAction_title,
                msg, SWT.SHEET);
          }
          try {
            IDE.openInternalEditorOnFileStore(page, fileStore);
            Shell shell = window.getShell();
            if (shell != null) {
              if (shell.getMinimized())
                shell.setMinimized(false);
              shell.forceActive();
            }
          } catch (PartInitException e) {
            String msg = NLS.bind(IDEWorkbenchMessages.OpenDelayedFileAction_message_errorOnOpen,
                    fileStore.getName());
            CoreException eLog = new PartInitException(e.getMessage());
            IDEWorkbenchPlugin.log(msg, new Status(IStatus.ERROR, IDEApplication.PLUGIN_ID, msg, eLog));
            MessageDialog.open(MessageDialog.ERROR, window.getShell(),
                IDEWorkbenchMessages.OpenDelayedFileAction_title,
                msg, SWT.SHEET);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

                    return status;
                }
                URI location = resource.getLocationURI();
                if (location != null) {
                    try {
                        IFileStore store = EFS.getStore(location);
                        if (store.fetchInfo().exists()) {
                            status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExistsDifferentCase);
                            return status;
                        }
                    } catch (CoreException e) {
                        status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_uri_location_unkown, BasicElementLabels.getURLPart(Resources.getLocationString(resource))));
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

                    return status;
                }
                URI location = resource.getLocationURI();
                if (location != null) {
                    try {
                        IFileStore store = EFS.getStore(location);
                        if (store.fetchInfo().exists()) {
                            status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExistsDifferentCase);
                            return status;
                        }
                    } catch (CoreException e) {
                        status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_uri_location_unkown, BasicElementLabels.getURLPart(Resources.getLocationString(resource))));
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    IPath path = new Path(name);
    VOrionStorage result = this;
    for (int i = 0, len = path.segmentCount(); i < len; i++) {
      // getChild() is a handle-only method; a child is provided regardless of whether this
      // store or the child store exists, or whether this store represents a directory or not.
      IFileStore childStore = result.store.getChild(path.segment(i));
      result = new VOrionStorage(path.segment(i), childStore, result);
    }
    return result;
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

  public String getLocation() {
   
    String fileURI =  this.file.toURI().toString();
    URI platformLocationURI = Activator.getDefault().getRootLocationURI();
    IFileStore root=null;
    try {
      root = EFS.getStore(platformLocationURI);
    } catch (CoreException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String rootURI = root.toURI().toString();
   
    return fileURI.substring(rootURI.length());
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

   

  }
  private boolean checkMaqettaProject(JSONObject projectObject) throws JSONException, CoreException{
    WebProject project = WebProject.fromId(projectObject.getString("Id"));
    IFileStore settings;
    settings = project.getProjectStore().getChild(IDavinciServerConstants.SETTINGS_DIRECTORY_NAME);
    if (settings == null)
      return false;
      IFileStore libFile = settings.getChild(IDavinciServerConstants.LIBS_FILE);
    if (libFile != null && libFile.fetchInfo().exists())
      return true;
    return false;
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    String projectName = orionPath.segment(2);

    WebProject proj = WebWorkspace.fromId(workspaceId).getProjectByName(projectName);

    String path = projectName;
    IFileStore child = null;
    for (int i = 3; i < orionPath.segmentCount(); i++) {
      child = proj.getProjectStore().getChild(orionPath.segment(i));
      path += "/" + child.getName();
    }
    return path;
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

        log.info(module.getFilePath());

        final File fileToOpen = new File(module.getFilePath());

        final IFileStore fileStore = EFS.getLocalFileSystem()
                .getStore(fileToOpen.toURI());
        final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                .getActivePage();

        try {
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.