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 voiddeleteObject(String objectName)Tablespace.ObjectPropertiesfindObject(String objectName)retrieve the object properties or null if not such an object existPathgetBucketRoot()StringgetName()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 prefixvoidputObject(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:Bucketretrieve 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:
listObjectsin interfaceBucketp- 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:
putObjectin interfaceBucket- Throws:
IOException
-
getObject
public byte[] getObject(String objectName) throws IOException
Description copied from interface:BucketRetrieve object from the bucket. Returns null if object does not exist.- Specified by:
getObjectin interfaceBucket- Returns:
- Throws:
IOException
-
deleteObject
public void deleteObject(String objectName) throws IOException
- Specified by:
deleteObjectin interfaceBucket- Throws:
IOException
-
findObject
public Tablespace.ObjectProperties findObject(String objectName) throws IOException
Description copied from interface:Bucketretrieve the object properties or null if not such an object exist- Specified by:
findObjectin interfaceBucket- Returns:
- Throws:
IOException
-
getBucketRoot
public Path getBucketRoot()
-
-