|
52 | 52 | *
|
53 | 53 | * @author <a href="mailto:[email protected]">Andrzej Taramina</a>
|
54 | 54 | * @author ljo
|
55 |
| - * @serial 2009-08-09 |
56 | 55 | * @version 1.2
|
57 |
| - * |
58 |
| - * @see |
59 |
| - * org.exist.xquery.BasicFunction#BasicFunction(org.exist.xquery.XQueryContext, |
| 56 | + * @serial 2009-08-09 |
| 57 | + * @see org.exist.xquery.BasicFunction#BasicFunction(org.exist.xquery.XQueryContext, |
60 | 58 | * org.exist.xquery.FunctionSignature)
|
61 | 59 | */
|
62 | 60 | public class DirectoryList extends BasicFunction {
|
63 | 61 |
|
64 |
| - private final static Logger logger = LogManager.getLogger(DirectoryList.class); |
65 |
| - |
66 |
| - final static String NAMESPACE_URI = FileModule.NAMESPACE_URI; |
67 |
| - final static String PREFIX = FileModule.PREFIX; |
68 |
| - |
69 |
| - final static QName FILE_ELEMENT = new QName("file", NAMESPACE_URI, PREFIX); |
70 |
| - final static QName LIST_ELEMENT = new QName("list", NAMESPACE_URI, PREFIX); |
71 |
| - |
72 |
| - final static QName DIRECTORY_ATTRIBUTE = new QName("directory", null, null); |
73 |
| - final static QName NAME_ATTRIBUTE = new QName("name", null, null); |
74 |
| - final static QName SIZE_ATTRIBUTE = new QName("size", null, null); |
75 |
| - final static QName HUMAN_SIZE_ATTRIBUTE = new QName("human-size", null, null); |
76 |
| - final static QName MODIFIED_ATTRIBUTE = new QName("modified", null, null); |
77 |
| - final static QName SUBDIR_ATTRIBUTE = new QName("subdir", null, null); |
78 |
| - |
79 |
| - public final static FunctionSignature[] signatures |
80 |
| - = { |
81 |
| - new FunctionSignature( |
82 |
| - new QName("directory-list", NAMESPACE_URI, PREFIX), |
83 |
| - "List all files, including their file size and modification time, " |
84 |
| - + "found in or below a directory, $directory. Files are located in the server's " |
85 |
| - + "file system, using filename patterns, $pattern. File pattern matching is based " |
86 |
| - + "on code from Apache's Ant, thus following the same conventions. For example:\n\n" |
87 |
| - + "'*.xml' matches any file ending with .xml in the current directory,\n- '**/*.xml' matches files " |
88 |
| - + "in any directory below the specified directory. This method is only available to the DBA role.", |
89 |
| - new SequenceType[]{ |
| 62 | + static final String NAMESPACE_URI = FileModule.NAMESPACE_URI; |
| 63 | + static final String PREFIX = FileModule.PREFIX; |
| 64 | + public static final FunctionSignature[] signatures = { |
| 65 | + new FunctionSignature( |
| 66 | + new QName("directory-list", NAMESPACE_URI, PREFIX), |
| 67 | + "List all files, including their file size and modification time, " |
| 68 | + + "found in or below a directory, $directory. Files are located in the server's " |
| 69 | + + "file system, using filename patterns, $pattern. File pattern matching is based " |
| 70 | + + "on code from Apache's Ant, thus following the same conventions. For example:\n\n" |
| 71 | + + "'*.xml' matches any file ending with .xml in the current directory,\n- '**/*.xml' matches files " |
| 72 | + + "in any directory below the specified directory. This method is only available to the DBA role.", |
| 73 | + new SequenceType[]{ |
90 | 74 | new FunctionParameterSequenceType("path", Type.ITEM,
|
91 | 75 | Cardinality.EXACTLY_ONE, "The base directory path or URI in the file system where the files are located."),
|
92 | 76 | new FunctionParameterSequenceType("pattern", Type.STRING,
|
93 | 77 | Cardinality.ZERO_OR_MORE, "The file name pattern")
|
94 |
| - }, |
95 |
| - new FunctionReturnSequenceType(Type.NODE, |
96 |
| - Cardinality.ZERO_OR_ONE, "a node fragment that shows all matching " |
97 |
| - + "filenames, including their file size and modification time, and " |
98 |
| - + "the subdirectory they were found in") |
99 |
| - ) |
100 |
| - }; |
| 78 | + }, |
| 79 | + new FunctionReturnSequenceType(Type.NODE, |
| 80 | + Cardinality.ZERO_OR_ONE, "a node fragment that shows all matching " |
| 81 | + + "filenames, including their file size and modification time, and " |
| 82 | + + "the subdirectory they were found in") |
| 83 | + ) |
| 84 | + }; |
| 85 | + static final QName FILE_ELEMENT = new QName("file", NAMESPACE_URI, PREFIX); |
| 86 | + static final QName LIST_ELEMENT = new QName("list", NAMESPACE_URI, PREFIX); |
| 87 | + |
| 88 | + static final QName DIRECTORY_ATTRIBUTE = new QName("directory", null, null); |
| 89 | + static final QName NAME_ATTRIBUTE = new QName("name", null, null); |
| 90 | + static final QName SIZE_ATTRIBUTE = new QName("size", null, null); |
| 91 | + static final QName HUMAN_SIZE_ATTRIBUTE = new QName("human-size", null, null); |
| 92 | + static final QName MODIFIED_ATTRIBUTE = new QName("modified", null, null); |
| 93 | + static final QName SUBDIR_ATTRIBUTE = new QName("subdir", null, null); |
| 94 | + private static final Logger logger = LogManager.getLogger(DirectoryList.class); |
101 | 95 |
|
102 | 96 | public DirectoryList(final XQueryContext context, final FunctionSignature signature) {
|
103 | 97 | super(context, signature);
|
|
0 commit comments