Package org.yamcs.yarch
Class FileSystemBucket
- java.lang.Object
-
- org.yamcs.yarch.FileSystemBucket
-
-
Constructor Summary
Constructors Constructor Description FileSystemBucket(String bucketName, Path root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteObject(String objectName)
Tablespace.ObjectProperties
findObject(String objectName)
retrieve the object properties or null if not such an object existPath
getBucketRoot()
String
getName()
get the bucket namebyte[]
getObject(String objectName)
Retrieve object from the bucket.List<Tablespace.ObjectProperties>
listObjects(String prefix, Predicate<Tablespace.ObjectPropertiesOrBuilder> p)
retrieve objects whose name start with prefix and that match the condition Note that searching by prefix is cheap, the condition will be evaluated for all objects that match the prefixvoid
putObject(String objectName, String contentType, Map<String,String> metadata, byte[] objectData)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.yamcs.yarch.Bucket
listObjects, listObjects, listObjects
-
-
-
-
Constructor Detail
-
FileSystemBucket
public FileSystemBucket(String bucketName, Path root) throws IOException
- Throws:
IOException
-
-
Method Detail
-
listObjects
public List<Tablespace.ObjectProperties> listObjects(String prefix, Predicate<Tablespace.ObjectPropertiesOrBuilder> p) throws IOException
Description copied from interface:Bucket
retrieve objects whose name start with prefix and that match the condition Note that searching by prefix is cheap, the condition will be evaluated for all objects that match the prefix- Specified by:
listObjects
in interfaceBucket
p
- predicate to be matched by the returned objects- Returns:
- list of objects
- Throws:
IOException
-
putObject
public void putObject(String objectName, String contentType, Map<String,String> metadata, byte[] objectData) throws IOException
- Specified by:
putObject
in interfaceBucket
- Throws:
IOException
-
getObject
public byte[] getObject(String objectName) throws IOException
Description copied from interface:Bucket
Retrieve object from the bucket. Returns null if object does not exist.- Specified by:
getObject
in interfaceBucket
- Returns:
- Throws:
IOException
-
deleteObject
public void deleteObject(String objectName) throws IOException
- Specified by:
deleteObject
in interfaceBucket
- Throws:
IOException
-
findObject
public Tablespace.ObjectProperties findObject(String objectName) throws IOException
Description copied from interface:Bucket
retrieve the object properties or null if not such an object exist- Specified by:
findObject
in interfaceBucket
- Returns:
- Throws:
IOException
-
getBucketRoot
public Path getBucketRoot()
-
-