-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistfiles.jsp
More file actions
49 lines (45 loc) · 1.96 KB
/
Copy pathlistfiles.jsp
File metadata and controls
49 lines (45 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<%@include file="util.jsp"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="logincheck.jsp"%>
<%
File exportDir = getStore(application).getExportDir(request.getParameter("name"));
File[] files = new File[0];
if (exportDir.exists()) {
files = exportDir.listFiles();
}
%>
<table width="100%" cellpadding="0" cellspacing="0">
<tr bgcolor="#efefef">
<td colspan="4"><img src="images/1trans.gif"/></td>
</tr>
<tr bgcolor="#dfdfdf">
<td class="default"> <b>filnamn</b></td>
<td class="default"><b>exportdatum</b></td>
<td class="default"><b>storlek</b></td>
<td class="default"></td>
</tr>
<tr bgcolor="#7f7f7f">
<td colspan="4"><img src="images/1trans.gif"/></td>
</tr>
<%
java.util.Set<java.io.File> set = new java.util.TreeSet<java.io.File>(new java.util.Comparator() { public int compare(Object o1, Object o2) {
File f1 = (File) o1, f2 = (File) o2;
return f1.getName().compareTo(f2.getName());
}});
for (java.io.File f: files) {
set.add(f);
}
for (java.io.File f: set) { %>
<tr>
<td class="default"> <% out.print(f.getName()); %></td>
<td class="default"><% out.print(new java.util.Date(f.lastModified())); %></td>
<td class="default"><% out.print(f.length()); %></td>
<td class="default"><a href="savefile.jsp?name=<%out.print(request.getParameter("name"));%>&file=<% out.print(java.net.URLEncoder.encode(f.getName())); %>">spara</a></td>
</tr>
<tr bgcolor="#dfdfdf">
<td colspan="4"><img src="images/1trans.gif"/></td>
</tr>
<% } %>
</table>