private static final Logger logger = LoggerFactory
.getLogger(SubFolderFileMapper.class);
public String getInternalFile(URI externalId) {
FedoraURI fedoraURI = new FedoraURI(externalId);
String guid = fedoraURI.getGuid();
String serialNumber = fedoraURI.getSerialNumber();
String dsid = fedoraURI.getDsid();
StringBuffer fileName = new StringBuffer();
if (serialNumber != null && !serialNumber.equals("")) {
if (dsid != null && !dsid.equals("")) {
fileName.append(dsid.toLowerCase() + "/");
} else {
fileName.append("*/");
}
}
fileName.append(guid);
if (serialNumber != null && !serialNumber.equals("")) {
fileName.append("_" + serialNumber);
} else if (dsid != null && !dsid.equals("")) {
fileName.append("_" + dsid.toLowerCase());
} else {
fileName.append("_*");
}
String suffix = ConverterManager.getSuffix(fedoraURI.getDsid());
if (suffix != null) {
fileName.append("." + suffix);
} else {
fileName.append(".*");
}