Skip to content

Commit

Permalink
Added the method to store system metadata. This method is only for th…
Browse files Browse the repository at this point in the history
…e test classes.
  • Loading branch information
taojing2002 committed Jun 26, 2024
1 parent 03ed1ba commit 32bec87
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/java/org/dataone/indexer/storage/HashStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,11 @@ public void storeObject(InputStream object, String pid) throws NoSuchAlgorithmEx
hashStore.storeObject(object, pid, null, null, null, -1);
}

@Override
public void storeMetadata(InputStream metadata, String pid) throws IOException,
IllegalArgumentException, FileNotFoundException,
InterruptedException, NoSuchAlgorithmException {
hashStore.storeMetadata(metadata, pid);
}

}
15 changes: 14 additions & 1 deletion src/main/java/org/dataone/indexer/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public InputStream retrieveSystemMetadata(String pid) throws IllegalArgumentExce
/**
* Store the input stream object into hash store. This method is only for the test classes.
* @param object the input stream of the object
* @param pid the pid which will be stored
* @param pid the identifier of the object which will be stored
* @throws NoSuchAlgorithmException
* @throws IOException
* @throws RuntimeException
Expand All @@ -52,4 +52,17 @@ public InputStream retrieveSystemMetadata(String pid) throws IllegalArgumentExce
public void storeObject(InputStream object, String pid) throws NoSuchAlgorithmException,
IOException,RuntimeException, InterruptedException;

/**
* Store the system metadata into hash store. This method is only for the test classes.
* @param metadata the input stream of the sytem metadata
* @param pid the identifier of the system metadata
* @throws IOException
* @throws IllegalArgumentException
* @throws FileNotFoundException
* @throws InterruptedException
* @throws NoSuchAlgorithmException
*/
public void storeMetadata(InputStream metadata, String pid) throws IOException,
IllegalArgumentException, FileNotFoundException,
InterruptedException, NoSuchAlgorithmException;
}

0 comments on commit 32bec87

Please sign in to comment.