public class ObjectStore extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
fullFileName |
static Integer |
IMAGE_COLORSPACE
paramter stored on cached images
|
static Integer |
IMAGE_DEPTH
paramter stored on cached images
|
static Integer |
IMAGE_HEIGHT
parameter stored on cached images
|
static Integer |
IMAGE_MASKCOL
paramter stored on cached images
|
static Integer |
IMAGE_pX
parameter stored on cached images
|
static Integer |
IMAGE_pY
parameter stored on cached images
|
static Integer |
IMAGE_WIDTH
parameter stored on cached images
|
static boolean |
isMultiThreaded
do not set unless you know what you are doing
|
static String |
multiThreaded_root_dir |
static String |
temp_dir
temp storage for the images so they are not held in memory
|
static long |
time
period after which we assumes files must be dead (ie from crashed instance)
default is four hour image time
|
| Constructor and Description |
|---|
ObjectStore()
ObjectStore -
Converted for Threading purposes -
To fix any errors please try replacing
ObjectStore with
{your instance of PdfDecoder}.getObjectStore() -
|
| Modifier and Type | Method and Description |
|---|---|
static void |
cachePageAsBytes(String key,
byte[] bytes) |
static void |
copy(InputStream from,
OutputStream to) |
static void |
copy(String source,
String destination)
Save Copy.
|
static void |
copyCMYKimages(String target_dir)
copies cmyk raw data from cmyk temp dir to target directory.
|
static File |
createTempFile(String filename) |
protected void |
finalize() |
void |
flush()
routine to remove all objects from temp store
|
static void |
flushPages()
delete all cached pages
|
static byte[] |
getCachedPageAsBytes(String key) |
String |
getCurrentFilename()
Get the file name - we use this as a get in our file repository -
|
String |
getCurrentFilepath()
Get the file path for current PDF
|
String |
getFileForCachedImage(String current_image) |
String |
getKey() |
byte[] |
getRawImageData(String i)
Retrieve byte data on disk.
|
Object |
getRawImageDataParameter(String imageID,
Integer key)
Return parameter stored for image or null.
|
void |
init(String current_key)
init method to pass in values for temp directory, unique key,
etc so program knows where to store files.
|
boolean |
isRawImageDataSaved(String number)
see if image data saved.
|
BufferedImage |
loadStoredImage(String current_image)
load a image when required and remove from store
|
static String |
removeIllegalFileNameCharacters(String s)
Remove troublesome characters from temp file names.
|
void |
saveAsCopy(String current_image,
String destination)
Save a Copy.
|
void |
saveRawImageData(String pageImgCount,
byte[] bytes,
int w,
int h,
int bpc,
int pX,
int pY,
byte[] maskCol,
int colorSpaceID) |
boolean |
saveStoredImage(String current_image,
BufferedImage image,
boolean file_name_is_path,
String type)
save buffered image as JPEG or tif
|
boolean |
saveStoredImageAsBytes(String currentImage,
BufferedImage image,
boolean file_name_is_path) |
void |
setEncHash(byte[] pass) |
void |
setFileToDeleteOnFlush(String rawFileName)
Add file to list we delete on flush so we can clear any
temp files we create.
|
void |
storeFileName(String name)
store filename as a key we can use to differentiate images,etc -
Note this method is not part of the API and is not guaranteed to
be in future versions of JPedal -
|
public static boolean isMultiThreaded
public static String temp_dir
public static final String multiThreaded_root_dir
public static final Integer IMAGE_WIDTH
public static final Integer IMAGE_HEIGHT
public static final Integer IMAGE_pX
public static final Integer IMAGE_pY
public static final Integer IMAGE_MASKCOL
public static final Integer IMAGE_COLORSPACE
public static final Integer IMAGE_DEPTH
public static final long time
public String fullFileName
public ObjectStore()
public String getCurrentFilename()
Note this method is not part of the API and is not guaranteed to be in future versions of JPedal -
public String getCurrentFilepath()
Note this method is not part of the API and is not guaranteed to be in future versions of JPedal -
public final void storeFileName(String name)
name - is of type Stringpublic final boolean saveStoredImageAsBytes(String currentImage, BufferedImage image, boolean file_name_is_path)
public final boolean saveStoredImage(String current_image, BufferedImage image, boolean file_name_is_path, String type)
current_image - is of type Stringimage - is of type BufferedImagefile_name_is_path - is of type booleantype - is of type Stringpublic final void init(String current_key)
current_key - is of type Stringpublic final BufferedImage loadStoredImage(String current_image)
current_image - is of type Stringpublic final void flush()
public static void copyCMYKimages(String target_dir)
target_dir - is of type Stringpublic final void saveAsCopy(String current_image, String destination)
current_image - is of type Stringdestination - is of type Stringpublic static void copy(String source, String destination)
source - is of type String.destination - is of type String.public static void copy(InputStream from, OutputStream to)
public static void flushPages()
public static byte[] getCachedPageAsBytes(String key)
public static void cachePageAsBytes(String key, byte[] bytes)
public void saveRawImageData(String pageImgCount, byte[] bytes, int w, int h, int bpc, int pX, int pY, byte[] maskCol, int colorSpaceID)
public boolean isRawImageDataSaved(String number)
number - is of type Stringpublic byte[] getRawImageData(String i)
i - is of type Stringpublic Object getRawImageDataParameter(String imageID, Integer key)
imageID - is of type Stringkey - is of type Integerpublic static File createTempFile(String filename) throws IOException
IOExceptionpublic static String removeIllegalFileNameCharacters(String s)
s - is of type Stringpublic void setFileToDeleteOnFlush(String rawFileName)
rawFileName - is of type Stringpublic String getKey()
public void setEncHash(byte[] pass)
Copyright © 2017. All rights reserved.