--- /dev/null
+package org.splat.simer;
+
+import java.io.File;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ResourceBundle;
+
+import org.splat.som.ConvertsRelation;
+
+
+public class FileFacade {
+
+ private String surl; // URL of the file
+ private String format; // Extension of the file
+ private String comment; // Short description
+ private String size;
+ private String date;
+
+// ==============================================================================================================================
+// Constructor
+// ==============================================================================================================================
+
+ public FileFacade (ConvertsRelation represented) {
+// ------------------------------------------------
+ ResourceBundle custom = ResourceBundle.getBundle("som", ApplicationSettings.getCurrentLocale());
+ File export = represented.getTo().asFile();
+ String path = export.getPath();
+ String[] table = path.split("\\x2E");
+ DecimalFormat tostring = new DecimalFormat(custom.getString("size.format")); // Locale size display format
+ SimpleDateFormat convert = new SimpleDateFormat(custom.getString("date.format")); // Date display format
+
+ surl = ApplicationSettings.getRepositoryURL() + path;
+ surl = surl.replaceAll("'", "\\\\'");
+ format = table[table.length-1].toUpperCase();
+ size = tostring.format(export.length()/1000);
+ date = convert.format(represented.getTo().getDate());
+ comment = represented.getDescription();
+ if (comment == null) comment = "";
+ }
+
+// ==============================================================================================================================
+// Getters
+// ==============================================================================================================================
+
+ public String getDate () {
+// ------------------------
+ return date;
+ }
+ public String getDescription () {
+// -------------------------------
+ return comment;
+ }
+ public String getFormat () {
+// -----------------------
+ return format;
+ }
+ public String getSize () {
+// ------------------------
+ return size;
+ }
+ public String getURL () {
+// -----------------------
+ return surl;
+ }
+}
\ No newline at end of file