Examples of IFileInfo


Examples of org.eclipse.core.filesystem.IFileInfo

      return super.isModifiable(element);
  }

  public boolean isReadOnly(Object element) {
    if (element instanceof FileStoreEditorInput) {
      IFileInfo info = fileInfoMap.get(element);
      if (info == null)
        return true// fail safe
      return info.getAttribute(EFS.ATTRIBUTE_READ_ONLY);
    } else
      return super.isReadOnly(element);
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

            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

Examples of org.eclipse.core.filesystem.IFileInfo

            IResource resource = resources[i];
            if (resource != null) {
                URI location = resource.getLocationURI();
                String message = null;
                if (location != null) {
                    IFileInfo info = IDEResourceInfoUtils.getFileInfo(location);
                    if (info == null || info.exists() == false) {
                        if (resource.isLinked()) {
                            message = NLS.bind(IDEWorkbenchMessages.CopyFilesAndFoldersOperation_missingLinkTarget,
                                    resource.getName());
                        } else {
                            message = NLS.bind(IDEWorkbenchMessages.CopyFilesAndFoldersOperation_resourceDeleted,
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

   * Change to executable permissions for non-windows machines.
   */
  public static void changePermissions(File file) {
    if (!Platform.getOS().equals(Platform.OS_WIN32)) {
      LocalFile localFile = new LocalFile(file);
      IFileInfo info = localFile.fetchInfo();
      if (!info.getAttribute(EFS.ATTRIBUTE_EXECUTABLE)) {
        info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true);
        try {
          localFile.putInfo(info, EFS.SET_ATTRIBUTES, null);
        } catch (CoreException e) {
          Logger.logException(e);
        }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

      IPath targetPath = LanguageModelInitializer.getTargetLocation(
          provider, Path.fromOSString(sourceFile.getAbsolutePath()),
          project);
      LocalFile targetDir = new LocalFile(targetPath.toFile());

      IFileInfo targetInfo = targetDir.fetchInfo();
      boolean update = !targetInfo.exists();
      if (!update) {
        IFileInfo sourceInfo = sourceDir.fetchInfo();
        update = targetInfo.getLastModified() < sourceInfo
            .getLastModified();
      }

      if (update) {
        targetDir.delete(EFS.NONE, new NullProgressMonitor());
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

    // update local history
    if (file.exists()){
      FileSystemResourceManager localManager = file.getLocalManager();
      IFileStore store = localManager.getStore(file);
      IFileInfo fileInfo = store.fetchInfo();
      localManager.getHistoryStore()
        .addState(file.getFullPath(), store, fileInfo, false);
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

      checkValidPath(path, FOLDER, true);
      final ISchedulingRule rule = workspace.getRuleFactory().createRule(this);
      try {
        workspace.prepareOperation(rule, monitor);
        IFileStore store = getStore();
        IFileInfo localInfo = store.fetchInfo();
        assertCreateRequirements(store, localInfo, updateFlags);
        workspace.beginOperation(true);
        if (force && !Workspace.caseSensitive && localInfo.exists()) {
          String name = getLocalManager().getLocalName(store);
          if (name == null || localInfo.getName().equals(name)) {
            delete(true, null);
          } else {
            // The file system is not case sensitive and a case variant exists at this location
            String msg = NLS.bind(Messages.resources_existsLocalDifferentCase, new Path(store.toString()).removeLastSegments(1).append(name).toOSString());
            throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), msg, null);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

  /* (non-Javadoc)
   * @see org.eclipse.ecf.provider.filetransfer.browse.LocalFileSystemBrowser#runDirectoryRequest()
   */
  protected void runRequest() throws Exception {
    final IFileInfo fileStoreInfo = fileStore.fetchInfo();
    if (fileStoreInfo.isDirectory()) {
      final IFileInfo[] fileInfos = fileStore.childInfos(EFS.NONE, null);
      remoteFiles = new IRemoteFile[fileInfos.length];
      for (int i = 0; i < fileInfos.length; i++) {
        remoteFiles[i] = new EFSRemoteFile(FileIDFactory.getDefault().createFileID(fileID.getNamespace(), new URL(directoryOrFile + "/" + fileInfos[i].getName())), fileInfos[i]); //$NON-NLS-1$
      }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

    try {
      IFileStore[] children= EFS.getStore(projectLocation).childStores(EFS.NONE, null);
      for (int i= 0; i < children.length; i++) {
        IFileStore child= children[i];
        IFileInfo info= child.fetchInfo();
        if (info.isDirectory() && info.exists() && !fOrginalFolders.contains(child.getName())) {
          fOrginalFolders.add(child);
        }
      }
    } catch (CoreException e) {
      JavaPlugin.log(e);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileInfo

  private void restoreExistingFolders(URI projectLocation) {
    try {
      IFileStore[] children= EFS.getStore(projectLocation).childStores(EFS.NONE, null);
      for (int i= 0; i < children.length; i++) {
        IFileStore child= children[i];
        IFileInfo info= child.fetchInfo();
        if (info.isDirectory() && info.exists() && !fOrginalFolders.contains(child)) {
          child.delete(EFS.NONE, null);
          fOrginalFolders.remove(child);
        }
      }
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.