Examples of IFileStore


Examples of org.eclipse.core.filesystem.IFileStore

                break;
            }
        }
        if (filePath != null) {
            final IPath path = new Path(filePath);
            IFileStore fileStore = EFS.getLocalFileSystem().getStore(
                    path.removeLastSegments(1));
            fileStore = fileStore.getChild(path.lastSegment());
            final IFileInfo fetchInfo = fileStore.fetchInfo();
            if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
                if (element instanceof IErlModule
                        && element.getParent() instanceof IErlExternal) {
                    return new ErlangExternalEditorInput(fileStore, (IErlModule) element);
                }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

        final URI uri = ifile.getRawLocationURI();
        boolean _tripleEquals = (uri == null);
        if (_tripleEquals) {
          return null;
        }
        IFileStore _store = EFS.getStore(uri);
        NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
        _xblockexpression = _store.toLocalFile(0, _nullProgressMonitor);
      }
      return _xblockexpression;
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
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

            int numberOfFilesNotFound = 0;
            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 );
                    }
                    catch ( PartInitException e )
                    {
                        MessageDialog.openError( window.getShell(), Messages.getString( "OpenFileAction.Error" ), e //$NON-NLS-1$
                            .getMessage() );
                    }
                }
                else
                {
                    if ( ++numberOfFilesNotFound > 1 )
                    {
                        notFound.append( '\n' );
                    }
                    notFound.append( fileStore.getName() );
                }
            }

            if ( numberOfFilesNotFound > 0 )
            {
View Full Code Here

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

          result.set(null);
        }

        @Override public void run() throws Exception {
          monitor.beginTask(calculatingChangedRegions, 20);
          IFileStore fileStore = buffer.getFileStore();
          ITextFileBufferManager fileBufferManager = createTextFileBufferManager();
          fileBufferManager.connectFileStore(fileStore, getSubProgressMonitor(monitor, 15));
          try {
            IDocument old = ((ITextFileBuffer) fileBufferManager.getFileStoreFileBuffer(fileStore)).getDocument();
            result.set(getChangedLineRegions(old));
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

  public IEditorPart openProtoFileInFileSystem(URI uri) throws PartInitException {
    IWorkbenchPage page = activeWorkbenchPage();
    if (page == null) {
      return null;
    }
    IFileStore fileStore = EFS.getLocalFileSystem().getStore(Path.fromOSString(uri.toFileString()));
    IEditorInput editorInput = new FileStoreEditorInput(fileStore);
    return openFile(editorInput, page);
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

            return;
          }
        }
      }

      IFileStore fileStore;
      try {
        fileStore= EFS.getStore(localFile.toURI());
      } catch (CoreException ex) {
        EditorsPlugin.log(ex.getStatus());
        String title= TextEditorMessages.AbstractDecoratedTextEditor_error_saveAs_title;
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    } else {
      ILocationProvider provider= (ILocationProvider) adaptable.getAdapter(ILocationProvider.class);
      if (provider instanceof ILocationProviderExtension) {
        URI uri= ((ILocationProviderExtension)provider).getURI(element);
        if (ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(uri).length == 0) {
          IFileStore fileStore= EFS.getStore(uri);
          manager.connectFileStore(fileStore, getProgressMonitor());
          fileBuffer= manager.getFileStoreTextFileBuffer(fileStore);
        }
      }
      if (fileBuffer == null && provider != null) {
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

   * @since 3.3
   */
  private void createFileStoreFromDocument(IProgressMonitor monitor, URI uri, IDocument document) throws CoreException {
    try {
      monitor.beginTask(TextEditorMessages.TextFileDocumentProvider_beginTask_saving, 2000);
      IFileStore fileStore= EFS.getStore(uri);
      FileBuffers.getTextFileBufferManager().connectFileStore(fileStore, monitor);
      ITextFileBuffer buffer= FileBuffers.getTextFileBufferManager().getFileStoreTextFileBuffer(fileStore);
      buffer.getDocument().set(document.get());
      buffer.commit(monitor, true);
      FileBuffers.getTextFileBufferManager().disconnectFileStore(fileStore, monitor);
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.