Skip to content

Commit

Permalink
Merge pull request #172 from bioinformatics-ua/imp/specialArguments
Browse files Browse the repository at this point in the history
Fixed #165: at and resolveURI with optional parameter
  • Loading branch information
bastiao committed Dec 20, 2015
2 parents a33fc46 + 0f37f2d commit 49820f9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private Iterator<StorageInputStream> createIterator(URI location){
}

@Override
public Iterable<StorageInputStream> at(URI location) {
public Iterable<StorageInputStream> at(URI location, Object ... args) {
return new MyIterable(location);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public StorageInterface getStorageForSchema(URI location) {
}

@Override
public Iterable<StorageInputStream> resolveURI(URI location) {
return pluginController.resolveURI(location);
public Iterable<StorageInputStream> resolveURI(URI location, Object ...args) {
return pluginController.resolveURI(location, args);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,15 @@ public Collection<StorageInterface> getStoragePlugins(boolean onlyEnabled) {
* @param location
* @return
*/
public Iterable<StorageInputStream> resolveURI(URI location)
public Iterable<StorageInputStream> resolveURI(URI location, Object ...args)
{
Collection<StorageInterface> storages = getStoragePlugins(true);

for (StorageInterface store : storages) {

if (store.handles(location))
{
logger.info("Resolving URI: "+location.toString()+" Storage: "+store.getName() );
return store.at(location);
return store.at(location, args);
}
}

Expand Down
5 changes: 4 additions & 1 deletion sdk/src/main/java/pt/ua/dicoogle/sdk/StorageInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ public interface StorageInterface extends DicooglePlugin {
* }</pre>
*
* @param location the location to read
* @param parameters a variable list of extra parameters for the retrieve
* @return an iterable of storage input streams
* @see StorageInputStream
*/
public Iterable<StorageInputStream> at(URI location);
public Iterable<StorageInputStream> at(URI location, Object ... parameters);

/**
* Stores a DICOM object into the storage.
*
* @param dicomObject Object to be Stored
* @param parameters a variable list of extra parameters for the retrieve
* @return The URI of the previously stored Object.
*/
public URI store(DicomObject dicomObject, Object ... parameters);
Expand All @@ -75,6 +77,7 @@ public interface StorageInterface extends DicooglePlugin {
* Stores a new element into the storage.
*
* @param inputStream an input stream with the contents to be stored
* @param parameters a variable list of extra parameters for the retrieve
* @return the URI of the stored data
* @throws IOException if an I/O error occurs
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ public interface DicooglePlatformInterface {
/** Quickly obtains all storage elements at the given location.
*
* @param location the location to retrieve
* @param args a variable list of extra parameters for the retrieve
* @return an iterable of storage input streams
*/
public Iterable<StorageInputStream> resolveURI(URI location);
public Iterable<StorageInputStream> resolveURI(URI location, Object ...args);

/** Obtains all installed storage plugins.
*
Expand Down

0 comments on commit 49820f9

Please sign in to comment.