private boolean isResolvableURI(final String aReferentID) {
return aReferentID.startsWith("http://") || aReferentID.startsWith("file://");
}
private ImageRecord getCachedImage(final String aReferentID) {
ImageRecord image = null;
if (isResolvableURI(aReferentID)) {
return image;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Checking in Pairtree file system for: {}", aReferentID);
}
try {
final PairtreeRoot pairtree = new PairtreeRoot(myJP2Dir);
final PairtreeObject dir = pairtree.getObject(aReferentID);
final String filename = PairtreeUtils.encodeID(aReferentID);
final File file = new File(dir, filename);
if (file.exists()) {
image = new ImageRecord();
image.setIdentifier(aReferentID);
image.setImageFile(file.getAbsolutePath());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("JP2 found in Pairtree cache: {}", file.getAbsolutePath());
}
} else if (LOGGER.isDebugEnabled()) {