protected Path buildPath(final String repository, final String branch) { return ioService.get(URI.create(String.format("git://%s@%s", branch, repository))); } }
private void init(final ByteArrayOutputStream outputStream, final String uri) throws URISyntaxException { this.originalPath = ioService.get(new URI(uri)); this.zipWriter = new ZipWriter(outputStream); }
@Override public List<RefactoringPageRow> buildResponse(final List<KObject> kObjects) { final List<RefactoringPageRow> result = new ArrayList<RefactoringPageRow>(kObjects.size()); for (final KObject kObject : kObjects) { final Path path = Paths.convert(ioService.get(URI.create(kObject.getKey()))); final RefactoringPathPageRow row = new RefactoringPathPageRow(); row.setValue(path); result.add(row); } return result; } }
public Path getPath(Path path, String version) throws URISyntaxException { String authority = path.toUri().getAuthority(); // master@uf-playground authority = version + authority.substring(authority.indexOf("@")); String scheme = path.getFileSystem().provider().getScheme(); // git String rawPath = path.toUri().getRawPath(); // projectname/org/something/file.txt String uri = scheme + "://" + authority + rawPath; return ioService.get(new URI(uri)); }
protected void updateLastModified() { final Path lastModifiedPath = ioService.get(systemRepository.getUri()).resolve(LAST_MODIFIED_MARKER_FILE); final CommentedOption commentedOption = new CommentedOption("system", "system repo updated"); ioService.write(lastModifiedPath, new Date().toString().getBytes(), commentedOption); // update the last value to avoid to be retriggered byt the monitor localLastModifiedValue.set(getLastModified()); }
private void fireDeleteEvent(final org.uberfire.backend.vfs.Path _path) { final Path path = ioService.get(URI.create(_path.toURI())); final T project = getProject(path.getParent()); deleteProjectEvent.fire(new DeleteProjectEvent(project)); }
@Before public void setup() { when(ioService.get(any(URI.class))).thenReturn(path); when(path.getFileSystem()).thenReturn(fileSystem); }
@Before public void setup() throws Exception { rootUri = new URI(ROOT_URI); when(fileSystem.supportedFileAttributeViews()).thenReturn(FS_ATTRIBUTES); when(rootPath.toUri()).thenReturn(rootUri); when(rootPath.getFileSystem()).thenReturn(fileSystem); doAnswer((Answer<org.uberfire.java.nio.file.Path>) invocationOnMock -> { final URI arg = (URI) invocationOnMock.getArguments()[0]; return arg.toURL().toString().equals(ROOT_URI) ? rootPath : null; }).when(ioService).get(any(URI.class)); tested = new VFSServicesServerImpl(ioService); }
@Test public void testBuildPath() { final Path path = ((PullRequestServiceImpl) service).buildPath("source/a", "develop"); final URI uri = URI.create("git://develop@source/a"); verify(ioService).get(uri); }
@Override public Path getDirectoryPath() { final Path dir = ioService().get(URI.create("git://repo-test/someDir" + new Random(10L).nextInt())); ioService().deleteIfExists(dir); return dir; }
@Override public Path getTargetPath() { final Path file = ioService().get(URI.create("git://repo-test/myTargetFile" + new Random(10L).nextInt() + ".txt")); ioService().deleteIfExists(file); return file; }
@Test public void testBuildHiddenPath() { ((PullRequestServiceImpl) service).buildHiddenPath(new PullRequestImpl(1, "source/a", "develop", "target/a", "master", PullRequestStatus.OPEN)); final URI uri = URI.create("git://PR-1-source/a/develop-master@target/a"); verify(ioService).get(eq(uri)); }
@Override public Path getFilePath() { final Path file = ioService().get(URI.create("git://repo-test/myfile" + new Random(10L).nextInt() + ".txt")); ioService().deleteIfExists(file); return file; }
@Override public Path getComposedDirectoryPath() { try { final File dir = createTempDirectory(); return ioService().get(dir.toURI()).resolve("path/to/myDir"); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public Path getFilePath() { try { final File dir = createTempDirectory(); return ioService().get(dir.toURI()).resolve("myTempFile.txt"); } catch (IOException e) { throw new RuntimeException(e); } }
protected Path getDirectoryPath( final String repositoryName ) { final Path dir = ioService().get( URI.create( "git://" + repositoryName + "/_someDir" + seed ) ); ioService().deleteIfExists( dir ); return dir; }
private Path getDirectoryPath(final String repositoryName) { final Path dir = ioService().get(URI.create("git://" + repositoryName + "/_someDir" + seed)); ioService().deleteIfExists(dir); return dir; }
private Path getDirectoryPath(final String repositoryName) { final Path dir = ioService().get(URI.create("git://" + repositoryName + "/_someDir" + seed)); ioService().deleteIfExists(dir); return dir; }
private Path getDirectoryPath(final String repositoryName) { final Path dir = ioService().get(URI.create("git://" + repositoryName + "/_someDir" + seed)); ioService().deleteIfExists(dir); return dir; }
@Test public void pomIsInPathRoot() throws Exception { final Path folderPath = ioService.get(this.getClass().getResource("/LegacyRepositoryStructure/Project1/").toURI()); final Set<Module> modules = finder.find(getResourceResolver(), new Branch("master", Paths.convert(folderPath))); assertFalse(modules.isEmpty()); }