/** * Resolves all spaces represented by the given query uri * * @param queryUri Data Spaces URI to query for; must be URI without space part being fully * defined, i.e. not pointing to any concrete data space; result spaces for that queries must * be suitable for user path. * @param ownerActiveObjectId Id of active object requesting this files, that will become owner of * returned {@link DataSpacesFileObject} instances. May be <code>null</code>, which * corresponds to anonymous (unimportant) owner. * @return * @throws FileSystemException */ public Map<DataSpacesURI, DataSpacesFileObject> resolveSpaces( final DataSpacesURI queryUri, final String ownerActiveObjectId) throws FileSystemException { final Map<DataSpacesURI, DataSpacesFileObject> result = new HashMap<DataSpacesURI, DataSpacesFileObject>(); if (logger.isDebugEnabled()) logger.debug("[VFSMountManager] Spaces access request: " + queryUri); final Set<SpaceInstanceInfo> spaces = directory.lookupMany(queryUri); if (spaces != null) { for (final SpaceInstanceInfo space : spaces) { final DataSpacesURI spaceUri = space.getMountingPoint(); if (!spaceUri.isSuitableForUserPath()) { logger.error( "[VFSMountManager] Resolved space is not suitable for user path: " + spaceUri); throw new IllegalArgumentException( "Resolved space is not suitable for user path: " + spaceUri); } try { ensureVirtualSpaceIsMounted(spaceUri, space); } catch (SpaceNotFoundException e) { ProActiveLogger.logImpossibleException(logger, e); throw new RuntimeException(e); } result.put(spaceUri, doResolveFile(spaceUri, ownerActiveObjectId, null)); } } return result; }
/** * resolves the given virtual uri into a DataSpaceFileObject. The VFS root is forced to the * spaceRootFOUri parameter. Mount the space if necessary * * @param queryUri Data Spaces URI to get access to * @param ownerActiveObjectId Id of active object requesting this file, that will become owner of * returned {@link DataSpacesFileObject} instance. May be <code>null</code>, which corresponds * to anonymous (unimportant) owner. * @param spaceRootFOUri forces the use of the provided VFS space root (in case there are several * roots) * @return * @throws FileSystemException * @throws SpaceNotFoundException */ public DataSpacesFileObject resolveFile( final DataSpacesURI queryUri, final String ownerActiveObjectId, String spaceRootFOUri) throws FileSystemException, SpaceNotFoundException { if (logger.isDebugEnabled()) logger.debug("[VFSMountManager] File access request: " + queryUri); if (!queryUri.isSuitableForUserPath()) { logger.error( "[VFSMountManager] Requested URI " + queryUri + " is not suitable for user path"); throw new IllegalArgumentException( "Requested URI " + queryUri + " is not suitable for user path"); } final DataSpacesURI spaceURI = queryUri.getSpacePartOnly(); ensureVirtualSpaceIsMounted(spaceURI, null); return doResolveFile(queryUri, ownerActiveObjectId, spaceRootFOUri); }