@Override public boolean delete( String basePath, ResourcePattern resourcePattern, boolean recursive, Counter counter) throws IOException, InterruptedException { return core.delete(basePath, resourcePattern, recursive, counter); }
/** * Truncates the current target. * @param resourcePattern the target resource pattern * @throws IOException if failed to perform by I/O error * @since 0.7.3 */ public void truncate(String resourcePattern) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Truncating Direct I/O resources: {0}:{1} (id={2})", //$NON-NLS-1$ fullPath, resourcePattern, id)); } try { dataSource.delete(basePath, FilePattern.compile(resourcePattern), true, new Counter()); } catch (InterruptedException e) { throw (IOException) new InterruptedIOException("interrupted").initCause(e); //$NON-NLS-1$ } }
@Override public boolean delete( String basePath, ResourcePattern resourcePattern, boolean recursive, Counter counter) throws IOException, InterruptedException { heartbeat.register(counter); try { return entity.delete(basePath, resourcePattern, recursive, counter); } finally { heartbeat.unregister(counter); } }
DirectDataSource source = repository.getRelatedDataSource(path); for (FilePattern pattern : patterns) { source.delete(basePath, pattern, recursive, new Counter());
pattern)); boolean succeed = repo.delete(basePath, resources, true, context.getCounter()); if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format(
private long delete(DirectIoPath dpath) { try { Counter counter = new Counter(); if (dpath.getResourcePattern().isPresent()) { dpath.getSource().getEntity().delete( dpath.getComponentPath().getPathString(), dpath.getResourcePattern().get(), recursive, counter); } else { dpath.getSource().getEntity().delete( BasePath.EMPTY.getPathString(), dpath.getComponentPath().asFilePattern(), recursive, counter); } return counter.get(); } catch (IOException | InterruptedException e) { throw new CommandExecutionException(MessageFormat.format( "error occurred while deleting file: {0}", dpath.getBarePath()), e); } } }