<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
import="java.io.*, java.lang.*, java.util.*, java.util.regex.*, java.util.StringTokenizer, java.util.Date, java.text.*, java.text.SimpleDateFormat, java.text.ParseException" %><%
System.setProperty ( "user.timezone", "GMT+09:00" ) ;
java.util.Date g_PageStartTime = new java.util.Date ( ) ;
response.setHeader ( "Cache-Control", "no-cache,no-store,must-revalidate" ) ;
response.setHeader ( "Pragma", "no-cache" ) ;
response.setDateHeader ( "Expires", 0 ) ;
response.setCharacterEncoding ( "UTF-8" ) ;
request.setCharacterEncoding ( "UTF-8" ) ;
String RootPath = "/download" ;
String tRootPath = DirectoryBrowser ( RootPath ) ; tRootPath = tRootPath.replace ( RootPath + "/" , "" ) ;
out.print ( tRootPath ) ;
%><%!
public static String DirectoryBrowser ( String RootPath )
{
String File_List = "" ;
RootPath = RootPath.replace ( "\\" , "/" ) ;
File FindDir = new File ( RootPath ) ;
String [ ] FindFile = FindDir.list ( ) ;
for ( int i = 0 ; i < FindFile.length ; i ++ )
{
File tDir = new File ( FindDir + "/" + FindFile [ i ] ) ;
if ( tDir.isDirectory ( ) == true )
{
File_List += DirectoryBrowser ( FindDir + "/" + FindFile [ i ] ) ;
}
else
{
File_List += RootPath + "/" + FindFile [ i ] + "\t|\t" + tDir.length ( ) + "<br>\n" ;
}
}
return File_List ;
}%>
'DB & SQL & web' 카테고리의 다른 글
[jsp:문법] 예외 처리 finally (0) | 2014.04.15 |
---|---|
[PostgreSQL] timestamp 합산 구하기 (0) | 2014.04.10 |
[PostgreSQL] 백업 & 복구 & CREATE DATABASE COPY (0) | 2013.09.15 |
[PostgreSQL] 외부 DATABASE 연결. (0) | 2013.08.13 |
[jsp] 한글 체크. (0) | 2013.07.25 |