Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
147 brianR 1
/*
2
 *   Copyright 2013 Brian Rosenberger (Brutex Network)
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
 
92 brianR 17
package net.brutex.xservices.ws.rs;
18
 
147 brianR 19
import java.io.File;
20
 
92 brianR 21
import javax.ws.rs.DefaultValue;
22
import javax.ws.rs.GET;
23
import javax.ws.rs.Path;
24
import javax.ws.rs.Produces;
25
import javax.ws.rs.QueryParam;
26
import javax.ws.rs.core.Context;
27
import javax.ws.rs.core.HttpHeaders;
28
import javax.ws.rs.core.Response;
147 brianR 29
import javax.ws.rs.core.UriInfo;
92 brianR 30
 
147 brianR 31
import net.brutex.xservices.ws.XServicesFault;
32
 
33
 
34
/**
35
 * The FileBrowsing Rest Service.
36
 *
37
 * @author Brian Rosenberger, bru(at)brutex.de
38
 */
39
 
92 brianR 40
@Path("/FileService/")
156 brianR 41
@Produces({ "text/xml" })
147 brianR 42
public abstract interface FileInfo {
43
 
44
	public final static String BASE_PATH = "/FileService/";
177 brianR 45
	public final static String SERVICE_NAME = "FileInfoService";
147 brianR 46
 
47
	/**
48
	 * Get the file/ directory listing.
49
	 *
50
	 * @param paramHttpHeaders the param http headers
51
	 * @param uriInfo request url info
52
	 * @param directory The directory to list.
53
	 * @param includeDirectories Whether or not to include directories in the listing. Default is true.
54
	 * @param includeFiles Whether or not to include files in the listing. Default is true.
55
	 * @param depth Include subdirectories down to a given depth. Default is 1.
56
	 * @param search Additional "Glob search pattern" for the file/ directory name. I.e. '*.log'
57
	 * @param itemsPerPage How many items to return with one call. Default is 50.
58
	 * @param page Paging support. Default is 1.
59
	 * @param useCache whether or not to use cache. Defaults to true.
60
	 * @return the FileInfo Set as an XML structure
61
	 */
62
	@GET
63
	@Path("getFiles/")
64
	public abstract Response getFiles(
65
			@Context HttpHeaders paramHttpHeaders,
66
			@Context UriInfo uriInfo,
67
			@QueryParam("directory") String directory,
68
			@QueryParam("includeDirectories") @DefaultValue("0") boolean includeDirectories,
69
			@QueryParam("includeFiles") @DefaultValue("1") boolean includeFiles,
70
			@QueryParam("depth") @DefaultValue("1") int depth,
71
			@QueryParam("search") String search,
72
			@QueryParam("itemsPerPage") @DefaultValue("50") int itemsPerPage,
73
			@QueryParam("page") @DefaultValue("1") int page,
74
			@QueryParam("usecache") @DefaultValue("1") boolean useCache);
75
 
76
	@GET
77
	@Path("getFile/")
78
	//@Produces("application/octet-stream")
79
	public abstract Response getFile(
80
			@Context HttpHeaders paramHttpHeaders,
81
			@QueryParam("file") String file);
92 brianR 82
}