Package java.nio.file

Examples of java.nio.file.Path.resolve()


        String filename = (String) propertyProvider.getProperty(Constants.PROPERTY_REPOSITORY_STORAGE_FILE, REPOSITORY_XML_NAME);
        Path storagePath = getRepositoryStoragePath(propertyProvider);

        storageDir = storagePath.toFile();
        repoFile = storagePath.resolve(filename).toFile();

        initRepositoryStorage();
    }

    public static Path getRepositoryStoragePath(PropertiesProvider propertyProvider) {
View Full Code Here


                        localData = Paths.get(userHome, "Local Settings", "Application Data");
                    if (!Files.isDirectory(localData))
                        throw new RuntimeException("%LOCALAPPDATA% is undefined, and neither "
                                + Paths.get(userHome, "AppData", "Local") + " nor "
                                + Paths.get(userHome, "Local Settings", "Application Data") + " have been found");
                    cache = localData.resolve(cacheName);
                }
            } else
                cache = Paths.get(userHome, "." + cacheName);
        }
        try {
View Full Code Here

  /** @return the GOPATH entry that contains the given goModulePath, if it's in the "src" folder of that entry.
   * Return null otherwise. */
  public Path findGoPathEntryForSourcePath(Path sourcePath) {
    Path workspaceEntry = findGoPathEntry(sourcePath);
   
    if(workspaceEntry != null && sourcePath.startsWith(workspaceEntry.resolve(SRC_DIR))) {
      return workspaceEntry;
    }
    return null;
  }
 
View Full Code Here

        if(!GoProjectEnvironment.isProjectInsideGoPath(project, goEnv.getGoPath())) {
          packageResourcePath = "src/" + packageResourcePath;
        } else {
          Path projectLocation = project.getLocation().toFile().toPath();
          GoPackageName projectGoPackage =
              goEnv.getGoPath().findGoPackageForSourceFile(projectLocation.resolve("dummy.go"));
         
          // snip project base name.
          packageResourcePath = StringUtil.segmentAfterMatch(packageResourcePath,
            projectGoPackage.getFullNameAsString() + "/");
         
View Full Code Here

  protected ILaunchConfiguration createConfiguration(ILaunchTarget launchable) {
    Path packageLocation = launchable.getAssociatedResource().getLocation().toFile().toPath();
    IProject project = launchable.getProject();
   
    GoPath goPath = GoProjectEnvironment.getEffectiveGoPath(project);
    GoPackageName goPackage = goPath.findGoPackageForSourceFile(packageLocation.resolve("dummy.go"));
    String suggestedName = project.getName() + " - " + goPackage.getFullNameAsString();
    return super.createConfiguration(launchable, suggestedName);
  }
 
}
View Full Code Here

   
    assertAreEqual(goEnv.getGoOS_GoArch_segment(), "windows_386");
   
    Path goRootSrc = goEnv.getGoRoot_Path().resolve("src/pkg");
   
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("pack/m.go")), gopackage("pack"));
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("pack/foo/m.go")), gopackage("pack/foo"));
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("../foo/m.go")), null);
  }
 
 
View Full Code Here

    assertAreEqual(goEnv.getGoOS_GoArch_segment(), "windows_386");
   
    Path goRootSrc = goEnv.getGoRoot_Path().resolve("src/pkg");
   
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("pack/m.go")), gopackage("pack"));
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("pack/foo/m.go")), gopackage("pack/foo"));
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("../foo/m.go")), null);
  }
 
 
  @Test
View Full Code Here

   
    Path goRootSrc = goEnv.getGoRoot_Path().resolve("src/pkg");
   
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("pack/m.go")), gopackage("pack"));
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("pack/foo/m.go")), gopackage("pack/foo"));
    assertAreEqual(goEnv.findGoPackageForSourceModule(goRootSrc.resolve("../foo/m.go")), null);
  }
 
 
  @Test
  public void testFindSourcePackage() throws Exception { testFindSourcePackage$(); }
View Full Code Here

        this.configAdmin = configAdmin;
        this.bootstrap = bootstrap;
        this.runtimeProperties = runtimeProperties;

        Path homePath = runtimeProperties.getHomePath();
        importDir = homePath.resolve("fabric").resolve("import").toFile().getAbsolutePath();
    }

    protected Object doExecute() throws Exception {

        // prevent creating fabric if already created
View Full Code Here

                if (savedGamesPath != null) {
                    rawPath = Paths.get(savedGamesPath);
                } else {
                    rawPath = new JFileChooser().getFileSystemView().getDefaultDirectory().toPath();
                }
                homePath = rawPath.resolve(TERASOLOGY_FOLDER_NAME);
                break;
            default:
                homePath = Paths.get(System.getProperty("user.home")).resolve(LINUX_HOME_SUBPATH);
                break;
        }
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.