| | |
| | | import de.uhilger.filecms.data.FileRef; |
| | | import de.uhilger.filecms.pub.AbstractComparator; |
| | | import de.uhilger.filecms.pub.FileNameComparator; |
| | | import de.uhilger.filecms.pub.ImgFileFilter; |
| | | import de.uhilger.wbx.Bild; |
| | | import de.uhilger.wbx.WbxUtils; |
| | | import static de.uhilger.wbx.WbxUtils.EMPTY_STRING; |
| | | import static de.uhilger.wbx.WbxUtils.WBX_FILE_BASE; |
| | | import de.uhilger.wbx.data.Inhalt; |
| | | import de.uhilger.wbx.web.TNServlet; |
| | | import java.io.File; |
| | | import java.io.FileFilter; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.FileOutputStream; |
| | |
| | | import java.security.Principal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.Enumeration; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipFile; |
| | | import java.util.zip.ZipOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.commons.io.FileUtils; |
| | | |
| | |
| | | logger.fine("listing path: " + path); |
| | | File dir = new File(path); |
| | | if (dir.exists()) { |
| | | File[] fileArray = dir.listFiles(); |
| | | File[] fileArray = dir.listFiles(new ImgFileFilter()); |
| | | if (orderBy != null && orderBy.equalsIgnoreCase("name")) { |
| | | Arrays.sort(fileArray, new FileNameComparator(order)); |
| | | } else { |
| | |
| | | } |
| | | return files; |
| | | } |
| | | |
| | | |
| | | public List<Inhalt> collect(String relativePath, int maxTiefe, int maxAnzahl, int len) { |
| | | |
| | | WbxUtils wu = new WbxUtils(); |
| | | HttpServletRequest req = getRequest(); |
| | | String requestUrl = req.getRequestURL().toString(); |
| | | String contextPath = req.getContextPath(); |
| | | return wu.collectFiles(requestUrl, contextPath, relativePath, maxTiefe, maxAnzahl, len); |
| | | } |
| | | |
| | | public FileRef newFolder(String relPath, String folderName) { |
| | | if (!relPath.startsWith(".")) { |