Subversion Repositories XServices

Rev

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

Rev Author Line No. Line
175 brianR 1
/*
2
 *   Copyright 2014 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
 
17
package net.brutex.xservices.ws.rs;
18
 
19
import java.io.File;
20
 
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;
29
import javax.ws.rs.core.UriInfo;
30
 
185 brianR 31
import org.apache.commons.jcs.access.exception.CacheException;
175 brianR 32
 
33
import net.brutex.xservices.ws.XServicesFault;
34
 
35
 
36
/**
37
 * The Dim CM Browsing Rest Service.
38
 *
39
 * @author Brian Rosenberger, bru(at)brutex.de
40
 */
41
 
42
@Path("/")
43
@Produces({ "text/xml" })
44
public abstract interface DIMCMInfo {
45
 
46
	public final static String BASE_PATH = "/DIMCMService/";
47
	public final static String SERVICE_NAME = "DIMCMInfoService";
48
 
49
	/**
50
	 * Get the file/ directory listing.
51
	 *
52
	 * @param paramHttpHeaders the param http headers
53
	 * @param uriInfo request url info
54
	 * @param directory The directory to list.
55
	 * @param includeDirectories Whether or not to include directories in the listing. Default is true.
56
	 * @param includeFiles Whether or not to include files in the listing. Default is true.
57
	 * @param depth Include subdirectories down to a given depth. Default is 1.
58
	 * @param search Additional "Glob search pattern" for the file/ directory name. I.e. '*.log'
59
	 * @param itemsPerPage How many items to return with one call. Default is 50.
60
	 * @param page Paging support. Default is 1.
61
	 * @param useCache whether or not to use cache. Defaults to true.
62
	 * @return the FileInfo Set as an XML structure
63
	 * @throws CacheException
64
	 */
65
	@GET
66
	@Path("getItems/")
67
	public abstract Response getFiles(
68
			@Context HttpHeaders paramHttpHeaders,
69
			@Context UriInfo uriInfo,
70
			@QueryParam("projSpec") String project,
71
			@QueryParam("directory") String directory,
72
			@QueryParam("recursive") @DefaultValue("false") boolean recursive,
73
			@QueryParam("includeFiles") @DefaultValue("1") boolean includeFiles,
74
			@QueryParam("depth") @DefaultValue("1") int depth,
75
			@QueryParam("search") String search,
76
			@QueryParam("itemsPerPage") @DefaultValue("50") int itemsPerPage,
77
			@QueryParam("page") @DefaultValue("1") int page,
78
			@QueryParam("usecache") @DefaultValue("true") boolean useCache) throws CacheException;
79
 
80
}