private void deleteHiddenBranch(final PullRequest pullRequest) { final Path path = this.buildHiddenPath(pullRequest); ioService.delete(path); if (logger.isDebugEnabled()) { logger.debug("Hidden branch {} deleted", pullRequest.toString()); } }
@Test(expected = NoSuchFileException.class) public void deleteNoSuchFileException() { final Path path = getFilePath(); ioService().deleteIfExists(path); ioService().delete(path); }
@Override public void removePerspectiveState(final String perspectiveId) { final Path perspectivePath = userServices.buildPath("perspectives", perspectiveId + ".perspective"); if (ioService.exists(perspectivePath)) { ioService.delete(perspectivePath); } }
@Override public void delete(Path path, DeleteOption... options) throws IllegalArgumentException, NoSuchFileException, DirectoryNotEmptyException, IOException, SecurityException { if (!authManager.authorize(toResource(path), getUser())) { throw new SecurityException(); } service.delete(path, options); }
@Override public void move(Path source, Path dest){ if (!isActive()) { return; } this.copy(source, dest); getIOService().delete(source); }
@Override public void move(Path source, Path dest) { this.copy(source, dest); ioService.delete(source); }
@Override public void deleteMedia( final Media media ) { final Path mediaPath = convert( media.getPath() ); ioService.delete( mediaPath ); mediaDeletedEvent.fire( new MediaDeleted( mediaPath.getParent().getParent().getFileName().toString(), media ) ); }
private void removeSpaceDirectory(final Space space) { final URI configPathURI = URI.create(SpacesAPI.resolveConfigFileSystemPath(SpacesAPI.Scheme.DEFAULT, space.getName())); final Path configPath = ioService.get(configPathURI); final JGitPathImpl configGitPath = (JGitPathImpl) configPath; final File spacePath = configGitPath.getFileSystem().getGit().getRepository().getDirectory().getParentFile().getParentFile(); ioService.delete(configPath.getFileSystem().getPath("")); spacePath.delete(); }
@Override public FileSystem newFileSystem(URI uri, Map<String, ?> env) throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException, IOException, SecurityException { final FileSystem fs = service.newFileSystem(uri, env); if (!authManager.authorize(toResource(fs), getUser())) { service.delete(fs.getPath(null)); throw new SecurityException(); } return fs; }
@Override public FileSystem newFileSystem(URI uri, Map<String, ?> env) throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException, IOException, SecurityException { final FileSystem fs = service.newFileSystem(uri, env); if (!authManager.authorize(toResource(fs), getUser())) { service.delete(fs.getPath(null)); throw new SecurityException(); } return fs; }
@Test public void testDelete() { tested.delete(ROOT_PATH); verify(ioService, times(1)).delete(any(org.uberfire.java.nio.file.Path.class)); }
@Test public void testDelete() { tested.delete(ROOT_PATH); verify(ioService, times(1)).delete(any(org.uberfire.java.nio.file.Path.class)); }
@Override public void removeBranch(final WorkspaceProject project, final Branch branch) { final org.uberfire.java.nio.file.Path branchPath = pathUtil.convert(branch.getPath()); ioService.delete(branchPath); configuredRepositories.refreshRepository(project.getRepository()); }
@Override public void delete( final Plugin plugin ) { final Path pluginPath = convert( plugin.getPath() ); if ( ioService.exists( pluginPath ) ) { ioService.delete( pluginPath.getParent(), StandardDeleteOption.NON_EMPTY_DIRECTORIES ); pluginDeletedEvent.fire( new PluginDeleted( plugin.getName(), plugin.getType(), sessionInfo ) ); } }
@Override public void removePerspectiveStates() { final Path perspectivesPath = userServices.buildPath("perspectives"); if (ioService.exists(perspectivesPath)) { try { ioService.startBatch(perspectivesPath.getFileSystem()); ioService.delete(perspectivesPath, StandardDeleteOption.NON_EMPTY_DIRECTORIES); } finally { ioService.endBatch(); } } }
private void maybeDeleteLock(final Path path) { try { ioService.startBatch(fileSystem); final LockInfo lockInfo = retrieveLockInfo(path); if (lockInfo.isLocked()) { ioService.delete(Paths.convert(lockInfo.getLock())); } } finally { ioService.endBatch(); } } }
@After public void clean() { fileSystemTestingUtils.cleanup(); try { ioService.delete(fileSystem.getPath(storage.getStoragePath())); } catch (Exception ex) { } } }
@Test(expected = DirectoryNotEmptyException.class) public void deleteDirectoryNotEmptyException() { final Path path = getDirectoryPath().resolveSibling("dirToBug"); ioService().createDirectories(path); ioService().write(path.resolve("myFile.txt"), "ooooo!"); ioService().delete(path); }
@Test(expected = DirectoryNotEmptyException.class) public void deleteDirectoryNotEmptyException() { final Path path = getDirectoryPath().resolveSibling("dirToBug"); ioService().createDirectories(path); ioService().write(path.resolve("myFile.txt"), "ooooo!"); ioService().delete(path); }