protected void initializeConfiguration() throws ConfigurationException { if ( getApplicationConfiguration().getConfigurationModel() != null ) { configure( getApplicationConfiguration() ); } }
public void moveItem( ResourceStoreRequest from, ResourceStoreRequest to ) throws UnsupportedStorageOperationException, ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { copyItem( from, to ); deleteItem( from ); }
public StorageItem dereferenceLink( StorageLinkItem link ) throws AccessDeniedException, ItemNotFoundException, IllegalOperationException, StorageException { return dereferenceLink( link, false, false ); }
public StorageItem retrieveItem( ResourceStoreRequest request ) throws ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it StorageItem item; try { request.pushRequestPath( route.getRepositoryPath() ); item = route.getTargetedRepository().retrieveItem( request ); } finally { request.popRequestPath(); } return mangle( false, request, route, item ); } else { // this is "above" repositories return retrieveVirtualPath( request, route ); } }
public Collection<StorageItem> list( ResourceStoreRequest request ) throws ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it Collection<StorageItem> items; try { request.pushRequestPath( route.getRepositoryPath() ); items = route.getTargetedRepository().list( request ); } finally { request.popRequestPath(); } ArrayList<StorageItem> result = new ArrayList<StorageItem>( items.size() ); for ( StorageItem item : items ) { result.add( mangle( true, request, route, item ) ); } return result; } else { // this is "above" repositories return listVirtualPath( request, route ); } }
public void createCollection( ResourceStoreRequest request, Map<String, String> userAttributes ) throws UnsupportedStorageOperationException, ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it try { request.pushRequestPath( route.getRepositoryPath() ); route.getTargetedRepository().createCollection( request, userAttributes ); } finally { request.popRequestPath(); } } else { // this is "above" repositories throw new IllegalRequestException( request, "The path '" + request.getRequestPath() + "' does not points to any repository!" ); } }
protected StorageItem mangle( boolean isList, ResourceStoreRequest request, RequestRoute route, StorageItem item ) throws AccessDeniedException, ItemNotFoundException, IllegalOperationException, StorageException { if ( isList ) { ( (AbstractStorageItem) item ).setPath( ItemPathUtils.concatPaths( route.getOriginalRequestPath(), item.getName() ) ); } else { ( (AbstractStorageItem) item ).setPath( route.getOriginalRequestPath() ); } if ( isFollowLinks() && item instanceof StorageLinkItem ) { return dereferenceLink( (StorageLinkItem) item ); } else { return item; } }
public boolean authorizePath( ResourceStoreRequest request, Action action ) TargetSet matched = this.getTargetsForRequest( request ); RequestRoute route = this.getRequestRouteForRequest( request );
public void setFollowLinks( boolean followLinks ) { getCurrentConfiguration( true ).setResolveLinks( followLinks ); }
@Override protected CRouting getCurrentConfiguration( boolean forWrite ) { return ( (CRoutingCoreConfiguration) getCurrentCoreConfiguration() ).getConfiguration( forWrite ); }
repository = getRepositoryForPathPrefixOrId( explodedPath[1], kind );
repositories = filterAccessToRepositories( repositories );
public void storeItem( ResourceStoreRequest request, InputStream is, Map<String, String> userAttributes ) throws UnsupportedStorageOperationException, ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it try { request.pushRequestPath( route.getRepositoryPath() ); route.getTargetedRepository().storeItem( request, is, userAttributes ); } finally { request.popRequestPath(); } } else { // this is "above" repositories throw new IllegalRequestException( request, "The path '" + request.getRequestPath() + "' does not points to any repository!" ); } }
public boolean isFollowLinks() { return getCurrentConfiguration( false ).isResolveLinks(); }
public void deleteItem( ResourceStoreRequest request ) throws UnsupportedStorageOperationException, ItemNotFoundException, IllegalOperationException, StorageException, AccessDeniedException { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it try { request.pushRequestPath( route.getRepositoryPath() ); route.getTargetedRepository().deleteItem( request ); } finally { request.popRequestPath(); } } else { // this is "above" repositories throw new IllegalRequestException( request, "The path '" + request.getRequestPath() + "' does not points to any repository!" ); } }
public TargetSet getTargetsForRequest( ResourceStoreRequest request ) { TargetSet result = new TargetSet(); try { RequestRoute route = getRequestRouteForRequest( request ); if ( route.isRepositoryHit() ) { // it hits a repository, mangle path and call it try { request.pushRequestPath( route.getRepositoryPath() ); result.addTargetSet( route.getTargetedRepository().getTargetsForRequest( request ) ); } finally { request.popRequestPath(); } } } catch ( ItemNotFoundException e ) { // nothing, empty set will be returned } return result; }
StorageException, AccessDeniedException RequestRoute fromRoute = getRequestRouteForRequest( from ); RequestRoute toRoute = getRequestRouteForRequest( to );