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
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
/* 
 * $Id$ 
 * 
 */ 
 
package com.roxen.roxen; 
 
/** 
 * The interface for modules which have a specific URL path in the 
 * virtual file system. 
 * 
 * @see Module 
 * 
 * @version     $Version$ 
 * @author      marcus 
 */ 
 
public interface LocationModule { 
 
  /** 
   * Returns the URL path handled by this module. 
   * 
   * @return the path name 
   */ 
  String queryLocation(); 
 
  /** 
   * Request a file from this module. 
   * 
   * @param  f   the path of the file relative to the location of 
   *             this module 
   * @param  id  the request object 
   * @return     a response, or <code>null</code> if no such 
   *             file exists. 
   */ 
  RoxenResponse findFile(String f, RoxenRequest id); 
 
  /** 
   * List the contents of a directory. 
   * 
   * @param  f   the path of the directory relative to the location of 
   *             this module 
   * @param  id  the request object 
   * @return     a list of filenames, or <code>null</code> if no such 
   *             directory exists. 
   */ 
  String[] findDir(String f, RoxenRequest id); 
 
  /** 
   * Get the real filename of a file. 
   * 
   * @param  f   the path of the file relative to the location of 
   *             this module 
   * @param  id  the request object 
   * @return     the path of the file in the host filesystem, or 
   *             <code>null</code> if this resource is not a real 
   *             file. 
   */ 
  String realFile(String f, RoxenRequest id); 
 
  /** 
   * Get the attributes of a file or directory. 
   * The attributes are a set of 7 integers.  These are: <code>mode</code>, 
   * <code>size</code>, <code>atime</code>, <code>mtime</code>, 
   * <code>ctime</code>, <code>uid</code>, <code>gid</code>. 
   *  
   * @param  f   the path of the file or directory relative to the 
   *             location of this module 
   * @param  id  the request object 
   * @return     the attributes of this file or directory, or 
   *             <code>null</code> if this information is not available. 
   */ 
  int[] statFile(String f, RoxenRequest id); 
 
}