Package com.intellij.openapi.vfs

Examples of com.intellij.openapi.vfs.VirtualFile


  @Nullable
  public void fetch(@NotNull Project project, @NotNull VirtualFile vFile, @NotNull String rev,
    @NotNull final IVcsFetchListener fetchListener)
  {
    VirtualFile result;
    final CacheKey key = new CacheKey(vFile, rev);

    synchronized (cache)
    {
      result = cache.get(key);
View Full Code Here


    }

    public void run(ProgressIndicator indicator)
    {
      indicator.setIndeterminate(true);
      VirtualFile result;
      try
      {
        result = fetchRevision(project, virtualFile, revision);
      }
      catch (RevuFriendlyException e)
View Full Code Here

    if (f.isAbsolute())
    {
      return LocalFileSystem.getInstance().findFileByIoFile(f);
    }

    VirtualFile baseDir = project.getBaseDir();
    if (baseDir == null)
    {
      LOGGER.warn("Can't get project base dir to compute relative path: " + f + ", project:" + project.getName());
      return null;
    }

    return LocalFileSystem.getInstance().findFileByPath(baseDir.getPath() + "/" + filePath);
  }
View Full Code Here

    if (f.isAbsolute())
    {
      return f;
    }

    VirtualFile baseDir = project.getBaseDir();
    if (baseDir == null)
    {
      LOGGER.warn("Can't get project base dir to compute relative path: " + f + ", project:" + project.getName());
      return f;
    }

    return new File(baseDir.getPath(), filePath);
  }
View Full Code Here

    return RevuBundle.message("general.vcsFileAndRev.text", vFile.getPath(), number);
  }

  public static boolean mayBrowseChangeLists(@NotNull Project project)
  {
    VirtualFile vFile = project.getBaseDir();
    if (vFile == null)
    {
      return false;
    }
View Full Code Here

    List<CommittedChangeList> changes = new ArrayList<CommittedChangeList>();
    List<VcsDirectoryMapping> mappings = ProjectLevelVcsManager.getInstance(project).getDirectoryMappings(vcs);
    for (VcsDirectoryMapping mapping : mappings)
    {
      VirtualFile vFile;
      if (mapping.isDefaultMapping())
      {
        vFile = project.getBaseDir();
      }
      else
View Full Code Here

  public void setupRootModel(final ModifiableRootModel rootModel) throws ConfigurationException {
    super.setupRootModel(rootModel);

    VirtualFile[] files = rootModel.getContentRoots();
    if (files.length > 0) {
      final VirtualFile contentRoot = files[0];

      final Project project = rootModel.getProject();
      myProjectName = project.getName();

      StartupManager.getInstance(project).runWhenProjectIsInitialized(new DumbAwareRunnable() {
View Full Code Here

    }
  }

  private void createKernelFiles(Project project, VirtualFile contentRoot) {
    try {
      final VirtualFile kernelRoot = contentRoot.createChildDirectory(this, "Kernel");
      MathematicaFileTemplateProvider.createFromTemplate(project, kernelRoot, MathematicaFileTemplateProvider.INIT, "init");
    } catch (IOException ignored) {
    } catch (Exception ignored) {
    }
  }
View Full Code Here

  private static void addJLinkJars(SdkModificator sdkModificator, String homePath) {

    final JarFileSystem jarFileSystem = JarFileSystem.getInstance();
    String path = homePath.replace(File.separatorChar, '/') + "/SystemFiles/Links/JLink/JLink.jar" + JarFileSystem.JAR_SEPARATOR;
    jarFileSystem.setNoCopyJarForPath(path);
    VirtualFile vFile = jarFileSystem.findFileByPath(path);
    sdkModificator.addRoot(vFile, OrderRootType.CLASSES);
  }
View Full Code Here

    Pattern initMPattern = Pattern.compile(".*init\\.m");
    if (addOns.isDirectory()) {
      final List<File> initFiles = FileUtil.findFilesByMask(initMPattern, addOns);
      for (File file : initFiles) {
        if (PACKAGE_INIT_PATTERN.matcher(file.getPath()).matches()) {
          final VirtualFile packageDirectory = LocalFileSystem.getInstance().findFileByPath(file.getPath().replace("Kernel/init.m", ""));
          sdkModificator.addRoot(packageDirectory, OrderRootType.SOURCES);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vfs.VirtualFile

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.