Class RemoteResource
- java.lang.Object
- 
- uk.org.esciencelab.researchobjectservice.serialization.RemoteResource
 
- 
 public class RemoteResource extends java.lang.ObjectA remote resource to be bagged.
- 
- 
Constructor SummaryConstructors Constructor Description RemoteResource(java.lang.String folder, com.fasterxml.jackson.databind.JsonNode entryNode)RemoteResource(java.nio.file.Path folder, java.lang.String filename, java.net.URL url, long length)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetChecksum(java.lang.String alg)java.lang.StringgetFilename()java.nio.file.PathgetFilepath()Get the file path relative to the root of the bag.java.nio.file.PathgetFullFolderPath()longgetLength()org.apache.taverna.robundle.manifest.PathMetadatagetPathMetadata()Create a PathMetadata entry for this resource, used to populate the "aggregates" section of the RO's manifest.json.java.net.URLgetUrl()voidsetChecksum(java.lang.String alg, java.lang.String value)java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
RemoteResourcepublic RemoteResource(java.nio.file.Path folder, java.lang.String filename, java.net.URL url, long length)- Parameters:
- folder- A relative path where this resource will be bagged (within `_bag_root_/data`).
- filename- The filename of this resource.
- url- The URL from which this resource should be fetched/
- length- The length in bytes of the resource.
 
 - 
RemoteResourcepublic RemoteResource(java.lang.String folder, com.fasterxml.jackson.databind.JsonNode entryNode) throws java.net.MalformedURLException- Parameters:
- folder- A string containing an absolute path of a folder in which to bag this resource. The root ("/") of the path is `_bag_root_/data`, so `/foo` would be bagged at `_bag_root_/data/foo` and `/` would be bagged at `_bag_root_/data`.
- entryNode- A JSON object conforming to `/schemas/_base.schema.json#/definitions/RemoteItem`, containing information on the filename, URL, length and checksums of this resource.
- Throws:
- java.net.MalformedURLException
 
 
- 
 - 
Method Detail- 
getUrlpublic java.net.URL getUrl() 
 - 
getFilenamepublic java.lang.String getFilename() 
 - 
getLengthpublic long getLength() 
 - 
getChecksumpublic java.lang.String getChecksum(java.lang.String alg) 
 - 
setChecksumpublic void setChecksum(java.lang.String alg, java.lang.String value)
 - 
getFullFolderPathpublic java.nio.file.Path getFullFolderPath() 
 - 
getFilepathpublic java.nio.file.Path getFilepath() Get the file path relative to the root of the bag. e.g. data/hello_world.txt.- Returns:
 
 - 
getPathMetadatapublic org.apache.taverna.robundle.manifest.PathMetadata getPathMetadata() Create a PathMetadata entry for this resource, used to populate the "aggregates" section of the RO's manifest.json.- Returns:
- The PathMetadata entry.
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-