Subversion Repositories XServices

Rev

Rev 92 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 94
Line 1... Line 1...
1
package net.brutex.xservices.ws.rs;
1
package net.brutex.xservices.ws.rs;
Line 2... Line 2...
2
 
2
 
3
import java.io.File;
3
import java.io.File;
-
 
4
import java.io.FileFilter;
4
import java.io.FileFilter;
5
import java.lang.reflect.Method;
5
import java.util.ArrayList;
6
import java.util.ArrayList;
Line 6... Line 7...
6
import java.util.List;
7
import java.util.List;
7
 
8
 
8
import javax.ws.rs.core.GenericEntity;
9
import javax.ws.rs.core.GenericEntity;
Line 9... Line 10...
9
import javax.ws.rs.core.HttpHeaders;
10
import javax.ws.rs.core.HttpHeaders;
10
import javax.ws.rs.core.Response;
11
import javax.ws.rs.core.Response;
Line -... Line 12...
-
 
12
 
-
 
13
import org.apache.jcs.JCS;
11
 
14
import org.apache.jcs.access.exception.CacheException;
Line 12... Line 15...
12
import org.apache.jcs.JCS;
15
 
13
import org.apache.jcs.access.exception.CacheException;
16
import net.brutex.xservices.security.StandardSecurityManager;
14
 
17
import net.brutex.xservices.security.UserIdentity;
Line 21... Line 24...
21
public class FileInfoImpl implements FileInfo {
24
public class FileInfoImpl implements FileInfo {
Line 22... Line 25...
22
 
25
 
23
	public Response getFiles(HttpHeaders h, String dir, boolean withDir,
26
	public Response getFiles(HttpHeaders h, String dir, boolean withDir,
Line -... Line 27...
-
 
27
			boolean withFiles, int level, String search, int count, int page) {
-
 
28
		
-
 
29
		StandardSecurityManager sec = new StandardSecurityManager();
-
 
30
		UserIdentity id = new UserIdentity();
-
 
31
 
-
 
32
		
-
 
33
		if( ! sec.canExecute(Thread.currentThread().getStackTrace()[1].getMethodName(), id)) {
-
 
34
			return null;
-
 
35
		}
24
			boolean withFiles, int level, String search, int count, int page) {
36
 
25
		
37
		
26
		System.out.println("Listing directory: " + dir);
38
		System.out.println("Listing directory: " + dir);
27
		if(level <= 0) level = 1;
39
		if(level <= 0) level = 1;
28
		if(level > 3) level = 3;
40
		if(level > 3) level = 3;