Package ome.io.nio
Class ThumbnailService
- java.lang.Object
-
- ome.io.nio.AbstractFileSystemService
-
- ome.io.nio.ThumbnailService
-
public class ThumbnailService extends AbstractFileSystemService
-
-
Field Summary
-
Fields inherited from class ome.io.nio.AbstractFileSystemService
FILES_PATH, PIXELS_PATH, ROOT_DEFAULT, THUMBNAILS_PATH
-
-
Constructor Summary
Constructors Constructor Description ThumbnailService(java.lang.String path)
Deprecated.ThumbnailService(java.lang.String path, boolean isReadOnlyRepo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createThumbnail(ome.model.display.Thumbnail thumbnail, byte[] buf)
Creates thumbnail on disk using byte arraybyte[]
getThumbnail(ome.model.display.Thumbnail thumbnail)
Return byte array of Thumbnailbyte[]
getThumbnail(ome.model.display.Thumbnail thumbnail, byte[] buf)
Return byte array of Thumbnail, providing byte arrayboolean
getThumbnailExists(ome.model.display.Thumbnail thumbnail)
Returns whether or not a thumbnail exists on disk.long
getThumbnailLength(ome.model.display.Thumbnail thumbnail)
Returns length of Thumbnail on diskjava.io.FileOutputStream
getThumbnailOutputStream(ome.model.display.Thumbnail thumbnail)
Return FileOutputStream of Thumbnailvoid
removeThumbnails(java.util.List<java.lang.Long> thumbnailIds)
Removes files from data repository based on a parameterized List of Long thumbnail ids-
Methods inherited from class ome.io.nio.AbstractFileSystemService
createSubpath, getFilesPath, getPath, getPixelsDirectory, getPixelsPath, getThumbnailPath
-
-
-
-
Method Detail
-
createThumbnail
public void createThumbnail(ome.model.display.Thumbnail thumbnail, byte[] buf) throws java.io.IOException
Creates thumbnail on disk using byte array- Parameters:
thumbnail
-buf
-- Throws:
java.io.IOException
-
getThumbnailLength
public long getThumbnailLength(ome.model.display.Thumbnail thumbnail)
Returns length of Thumbnail on disk- Parameters:
thumbnail
-
-
getThumbnail
public byte[] getThumbnail(ome.model.display.Thumbnail thumbnail) throws java.io.IOException
Return byte array of Thumbnail- Parameters:
thumbnail
-- Returns:
- a byte array
- Throws:
java.io.IOException
-
getThumbnail
public byte[] getThumbnail(ome.model.display.Thumbnail thumbnail, byte[] buf) throws java.io.IOException
Return byte array of Thumbnail, providing byte array- Parameters:
thumbnail
-buf
-- Returns:
- a byte array
- Throws:
java.io.IOException
-
getThumbnailOutputStream
public java.io.FileOutputStream getThumbnailOutputStream(ome.model.display.Thumbnail thumbnail) throws java.io.IOException
Return FileOutputStream of Thumbnail- Parameters:
thumbnail
-- Returns:
- a
FileOutputStream
- Throws:
java.io.IOException
-
getThumbnailExists
public boolean getThumbnailExists(ome.model.display.Thumbnail thumbnail) throws java.io.IOException
Returns whether or not a thumbnail exists on disk.- Parameters:
thumbnail
- The thumbnail metadata.- Returns:
- See above.
- Throws:
java.io.IOException
-
removeThumbnails
public void removeThumbnails(java.util.List<java.lang.Long> thumbnailIds)
Removes files from data repository based on a parameterized List of Long thumbnail ids- Parameters:
thumbnailIds
- - Long file keys to be deleted- Throws:
ome.conditions.ResourceError
- If deletion fails.
-
-