throws DAOException {
File metadata = new File(aFile.getParentFile(),
LocalGFileManager.META_DATA + File.separator + aFile.getName());
if ( metadata.exists() ) {
if ( metadata.isDirectory() ) {
throw new DAOException("{" +
metadata.getAbsolutePath() + "} should be a file");
}
} else {
boolean success;
try {
success = metadata.createNewFile();
} catch (IOException e) {
throw new DAOException(e);
}
if ( !success ) {
throw new DAOException("Can not create file {" +
metadata.getAbsolutePath() + "}");
}
}
return metadata;
}