src/de/uhilger/mediaz/api/ListFileHandler.java | ●●●●● patch | view | raw | blame | history | |
src/de/uhilger/mediaz/store/StorageFile.java | ●●●●● patch | view | raw | blame | history |
src/de/uhilger/mediaz/api/ListFileHandler.java
@@ -30,6 +30,8 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; @@ -79,6 +81,7 @@ File dir = new File(fileBase, fName); logger.fine(dir.getAbsolutePath()); File[] files = dir.listFiles(); Arrays.sort(files); ArrayList list = new ArrayList(); if(files != null) { for(File file : files) { @@ -103,6 +106,7 @@ list.add(sf); } } //Collections.sort(list); String json = jsonWithCustomType(list, "Medialiste"); logger.fine(json); e.sendResponseHeaders(200, json.length()); src/de/uhilger/mediaz/store/StorageFile.java
@@ -17,6 +17,8 @@ */ package de.uhilger.mediaz.store; import java.util.Objects; /** * * @author ulrich @@ -81,5 +83,35 @@ } } @Override public String toString() { return "StorageFile{" + "name=" + name + '}'; } @Override public int hashCode() { int hash = 3; return hash; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final StorageFile other = (StorageFile) obj; if (!Objects.equals(this.name, other.name)) { return false; } return true; } }