Package org.eclipse.core.filesystem

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


      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

    // 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

      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

  /* (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

    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

  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

   */
  protected boolean isSystemFileReadOnly(FileInfo info)  {
    IFileStore fileStore= getFileStore(info);
    if (fileStore == null)
      return false;
    IFileInfo fileInfo= fileStore.fetchInfo();
    return fileInfo.exists() && fileInfo.getAttribute(EFS.ATTRIBUTE_READ_ONLY);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.filesystem.IFileInfo

Copyright © 2018 www.massapicom. 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.