@Test public void createChecksumFile() throws Exception { Method createChecksumFileMethod = Repos.class.getDeclaredMethod("createChecksumFile", Scope.class, String.class); createChecksumFileMethod.setAccessible(true); String result = (String) createChecksumFileMethod.invoke(null, Scope.Default, null); assertNull(result); result = (String) createChecksumFileMethod.invoke(null, Scope.Default, null); assertNull(result); result = (String) createChecksumFileMethod.invoke(null, Scope.Default, "foo"); assertNull(result); result = (String) createChecksumFileMethod.invoke(null, Scope.Default, FileUtil.pathFromParts("foo", "bar")); assertEquals("foo/checksum.properties", result); }
private static String createChecksumFile(Scope scope, String path) { if (path == null) { return null; } int index = path.lastIndexOf(File.separatorChar); if (index == -1) { return null; } String artifactsLabelName = Props.get("artifacts.label", Context.named("project"), scope).value(); Scope artifactsLabel = Scope.named(artifactsLabelName); return FileUtil.pathFromParts(path.substring(0, index), String.format("checksum%s.properties", artifactsLabel.getFileSuffix())); }
Repos { private static String createChecksumFile(Scope scope, String path) { if (path == null) { return null; } int index = path.lastIndexOf(File.separatorChar); if (index == -1) { return null; } String artifactsLabelName = Props.get("artifacts.label", Context.named("project"), scope).value(); Scope artifactsLabel = Scope.named(artifactsLabelName); return FileUtil.pathFromParts(path.substring(0, index), String.format("checksum%s.properties", artifactsLabel.getFileSuffix())); } }
Repos { private static String createChecksumFile(Scope scope, String path) { if (path == null) { return null; } int index = path.lastIndexOf(File.separatorChar); if (index == -1) { return null; } String artifactsLabelName = Props.get("artifacts.label", Context.named("project"), scope).value(); Scope artifactsLabel = Scope.named(artifactsLabelName); return FileUtil.pathFromParts(path.substring(0, index), String.format("checksum%s.properties", artifactsLabel.getFileSuffix())); } private  Repos(); }
Repos { private static String createChecksumFile(Scope scope, String path) { if (path == null) { return null; } int index = path.lastIndexOf(File.separatorChar); if (index == -1) { return null; } String artifactsLabelName = Props.get("artifacts.label", Context.named("project"), scope).value(); Scope artifactsLabel = Scope.named(artifactsLabelName); return FileUtil.pathFromParts(path.substring(0, index), String.format("checksum%s.properties", artifactsLabel.getFileSuffix())); } private  Repos(); static String getDirectoryPathForRepo(RepositoryAtom repositoryAtom); static boolean install(Scope scope, RepositoryAtom localRepo); static boolean install(Scope scope, RepositoryAtom localRepo, String artifactName, DependencyAtom dependencyAtom); static boolean installArtifact(Scope scope, File artifact, File dependenciesFile, DependencyAtom dependencyAtom,
                                          RepositoryAtom localRepo); static RepositoryRegistry createRepositoryRegistry(File configDirectory, Scope scope,
                                                              DependencyAtom syntheticDependencyKey,
                                                              List<DependencyAtom> syntheticDependencies); static RepositoryAtom getExistingRepo(File configDir, Scope scope, String repository); static PropFile.Prop getAuthPropFromRepo(File configDir, Scope scope, RepositoryAtom repositoryAtom); static PropFile.Prop addAuthRepomngrProp(PropFile repomngr, String repository, Auth auth); static Auth getAuth(File configDir, Scope scope, RepositoryAtom repositoryAtom); }
Repos { private static String createChecksumFile(Scope scope, String path) { if (path == null) { return null; } int index = path.lastIndexOf(File.separatorChar); if (index == -1) { return null; } String artifactsLabelName = Props.get("artifacts.label", Context.named("project"), scope).value(); Scope artifactsLabel = Scope.named(artifactsLabelName); return FileUtil.pathFromParts(path.substring(0, index), String.format("checksum%s.properties", artifactsLabel.getFileSuffix())); } private  Repos(); static String getDirectoryPathForRepo(RepositoryAtom repositoryAtom); static boolean install(Scope scope, RepositoryAtom localRepo); static boolean install(Scope scope, RepositoryAtom localRepo, String artifactName, DependencyAtom dependencyAtom); static boolean installArtifact(Scope scope, File artifact, File dependenciesFile, DependencyAtom dependencyAtom,
                                          RepositoryAtom localRepo); static RepositoryRegistry createRepositoryRegistry(File configDirectory, Scope scope,
                                                              DependencyAtom syntheticDependencyKey,
                                                              List<DependencyAtom> syntheticDependencies); static RepositoryAtom getExistingRepo(File configDir, Scope scope, String repository); static PropFile.Prop getAuthPropFromRepo(File configDir, Scope scope, RepositoryAtom repositoryAtom); static PropFile.Prop addAuthRepomngrProp(PropFile repomngr, String repository, Auth auth); static Auth getAuth(File configDir, Scope scope, RepositoryAtom repositoryAtom);  }