* Fields initialization class.
*/
public static class Properties extends Persistent.Properties {
- // ------------------------------------------------------------
private DocumentType type = null;
private String did = null; // Only for searching from a given reference
private ProjectElement owner = null; // Only for constructing a document
/**
* Get the format.
+ *
* @return the format
*/
public String getFormat() {
/**
* Initialization constructor.
+ *
* @param dprop
* @throws MissedPropertyException
* @throws InvalidPropertyException
// Public member functions
// ==============================================================================================================================
+ /**
+ * Get the attached file of the given format.
+ *
+ * @param format
+ * the file format
+ * @return the attached file or null if not found
+ */
public File getAttachedFile(final String format) {
List<Relation> exports = getRelations(ConvertsRelation.class);
-
- for (Iterator<Relation> i = exports.iterator(); i.hasNext();) {
- File export = (File) i.next().getTo();
+ File res = null;
+ for (Relation rel : exports) {
+ File export = (File) rel.getTo();
if (export.getFormat().equals(format)) {
- return export;
+ res = export;
+ break;
}
}
- return null;
+ return res;
}
public User getAuthor() {