private void deleteItem(final Repository repository, final StorageItem item) throws Exception { repository.deleteItem(item.getResourceStoreRequest()); }
@Override public void touchItemLastRequested( final long timestamp, final StorageItem storageItem ) throws IOException { if ( storageItem instanceof StorageCollectionItem ) { // not storing attributes of directories return; } touchItemLastRequested( timestamp, storageItem.getResourceStoreRequest(), storageItem.getRepositoryItemUid(), storageItem.getRepositoryItemAttributes() ); }
@Override public void storeItem(Repository repository, StorageItem item) throws UnsupportedStorageOperationException, LocalStorageException { if (!item.getPath().startsWith("/.nexus")) { RubygemsFile file = fileSystem.file(item.getResourceStoreRequest()); if (file.type() != FileType.NOT_FOUND) { item.getResourceStoreRequest().setRequestPath(file.storagePath()); ((AbstractStorageItem) item).setPath(file.storagePath()); } } super.storeItem(repository, item); }
repository.deleteItemWithChecksums(new ResourceStoreRequest(item.getResourceStoreRequest())); deleted = deleted + 1;
@Override public void processItem( WalkerContext ctx, StorageItem item ) { long now = System.currentTimeMillis(); long limitDate = now - age; if ( item instanceof StorageFileItem && // ( age == DefaultWastebasket.ALL || item.getModified() < limitDate ) ) { try { ctx.getRepository().getLocalStorage().shredItem( ctx.getRepository(), item.getResourceStoreRequest() ); } catch ( ItemNotFoundException e ) { // silent } catch ( UnsupportedStorageOperationException e ) { // silent? } catch ( LocalStorageException e ) { // silent? } } }
protected Object renderItem(Context context, Request req, Response res, Variant variant, ResourceStore store, StorageItem item) throws IOException, AccessDeniedException, NoSuchResourceStoreException, IllegalOperationException, ItemNotFoundException, StorageException, ResourceException { if (isDescribe(req)) { return renderDescribeItem(context, req, res, variant, store, item.getResourceStoreRequest(), item, null); } if (!item.isVirtual()) { if (!item.getRepositoryItemUid().getBooleanAttributeValue(IsRemotelyAccessibleAttribute.class)) { getLogger().debug( String.format("Request for remotely non-accessible UID %s is made and refused", item.getRepositoryItemUid().toString())); throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "Resource is not found."); } } if (item instanceof StorageFileItem) { return renderStorageFileItem(req, (StorageFileItem) item); } else if (item instanceof StorageLinkItem) { return renderStorageLinkItem(context, req, res, variant, store, (StorageLinkItem) item); } else if (item instanceof StorageCollectionItem) { return renderStorageCollectionItem(context, req, res, variant, store, (StorageCollectionItem) item); } return null; }
return renderDescribeItem( context, req, res, variant, store, item.getResourceStoreRequest(), item, null );
item.setExpired( false ); File target = getFileFromBase( repository, item.getResourceStoreRequest() ); getFSPeer().storeItem( repository, getBaseDir( repository, item.getResourceStoreRequest() ), item, target, cl );
final Action action = getResultingActionOnWrite( item.getResourceStoreRequest() ); removeFromNotFoundCache( item.getResourceStoreRequest() );