Package ome.io.nio
Class AbstractFileSystemService
- java.lang.Object
-
- ome.io.nio.AbstractFileSystemService
-
- Direct Known Subclasses:
OriginalFilesService
,PixelsService
,ThumbnailService
public class AbstractFileSystemService extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FILES_PATH
static java.lang.String
PIXELS_PATH
static java.lang.String
ROOT_DEFAULT
static java.lang.String
THUMBNAILS_PATH
-
Constructor Summary
Constructors Constructor Description AbstractFileSystemService(java.lang.String path)
Deprecated.AbstractFileSystemService(java.lang.String path, boolean isReadOnlyRepo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createSubpath(java.lang.String path)
Makes sure that for a given path, its subpath exists.java.lang.String
getFilesPath(java.lang.Long id)
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs.protected java.lang.String
getPath(java.lang.String prefix, java.lang.Long id)
Returns a numbered path relative to the root of this service for a given prefix, but is ignorant of FS and similar constructs.java.lang.String
getPixelsDirectory()
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs.java.lang.String
getPixelsPath(java.lang.Long id)
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs.java.lang.String
getThumbnailPath(java.lang.Long id)
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs.
-
-
-
Method Detail
-
createSubpath
protected void createSubpath(java.lang.String path)
Makes sure that for a given path, its subpath exists. For example, given the path "/foo/bar/foobar.txt" the method will make sure the directory structure "/foo/bar" exists.- Parameters:
path
- the path to check for subpath existence.
-
getPixelsDirectory
public java.lang.String getPixelsDirectory()
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs. For example, this will return "ROOT/Pixels/"- Returns:
- the path relative to the root
-
getPixelsPath
public java.lang.String getPixelsPath(java.lang.Long id)
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs. For example, given an id of 12345 this will return "ROOT/Pixels/Dir-123/Dir-456/123456"- Parameters:
id
- the Pixels identifier- Returns:
- the path relative to the root
-
getFilesPath
public java.lang.String getFilesPath(java.lang.Long id)
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs. For example, given an id of 123456 this will return "ROOT/Files/Dir-123/Dir-456/123456"- Parameters:
id
- the Files identifier- Returns:
- the path relative to the root
-
getThumbnailPath
public java.lang.String getThumbnailPath(java.lang.Long id)
Returns a numbered path relative to the root of this service, but is ignorant of FS and similar constructs. For example, given an id of 123456 this will return "ROOT/Thumbnails/Dir-123/Dir-456/123456"- Parameters:
id
- the thumbnail identifier- Returns:
- the path relative to the root
-
getPath
protected java.lang.String getPath(java.lang.String prefix, java.lang.Long id)
Returns a numbered path relative to the root of this service for a given prefix, but is ignorant of FS and similar constructs. For example, given an id of 123456 this will return "ROOT//Dir-123/Dir-456/123456". - Parameters:
prefix
- id type prefixid
- the model object identifier- Returns:
- the path relative to the root
-
-