}
}
public WGFileMetaData getFileMetaData(String filename) throws WGAPIException {
if ((_entity instanceof Content || _entity instanceof FileContainer) == false) {
throw new WGIllegalStateException("Method getFileMetaData() is not supported on '" + _entity.getClass().getName() + "'.");
}
if (_parent.useOptimizedFileHandling()) {
Entity metaEntity = retrieveFileMetaEntity(filename);
if (metaEntity != null) {
WGFileMetaData metaData = null;
if (metaEntity instanceof ContentFileMeta) {
ContentFileMeta meta = (ContentFileMeta) metaEntity;
metaData = new WGFileMetaData();
meta.fill(metaData);
}
else if (metaEntity instanceof ContainerFileMeta) {
ContainerFileMeta meta = (ContainerFileMeta) metaEntity;
metaData = new WGFileMetaData();
meta.fill(metaData);
}
if (metaData != null) {
if (_parent._ddlVersion >= WGDatabase.CSVERSION_WGA5) {
metaData.setExtensionDataHandler(new FileExtDataHandler(_parent, metaEntity));
}
return metaData;
}
else {
throw new WGIllegalArgumentException("Unsupported entity type '" + metaEntity.getClass().getName() + "'.");
}
}
else {
// file not found
return null;
}
} else {
throw new WGIllegalStateException("Method getFileMetaData() is not supported in the default file handling mode. You have to enable 'optimizedFileHandling'");
}
}