author | amurillo |
Fri, 10 Jun 2016 15:13:40 -0700 | |
changeset 38958 | d8a4ce6d05ad |
parent 36526 | 3b41f1c69604 |
child 42261 | bb52b5514ad5 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
36526 | 2 |
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package javax.tools; |
|
27 |
||
28 |
import java.io.Closeable; |
|
29 |
import java.io.Flushable; |
|
30 |
import java.io.IOException; |
|
31 |
import java.util.Iterator; |
|
36526 | 32 |
import java.util.ServiceLoader; |
10 | 33 |
import java.util.Set; |
36526 | 34 |
|
10 | 35 |
import static javax.tools.JavaFileObject.Kind; |
36 |
||
37 |
/** |
|
38 |
* File manager for tools operating on Java™ programming language |
|
39 |
* source and class files. In this context, <em>file</em> means an |
|
40 |
* abstraction of regular files and other sources of data. |
|
41 |
* |
|
42 |
* <p>When constructing new JavaFileObjects, the file manager must |
|
43 |
* determine where to create them. For example, if a file manager |
|
44 |
* manages regular files on a file system, it would most likely have a |
|
45 |
* current/working directory to use as default location when creating |
|
46 |
* or finding files. A number of hints can be provided to a file |
|
47 |
* manager as to where to create files. Any file manager might choose |
|
48 |
* to ignore these hints. |
|
49 |
* |
|
50 |
* <p>Some methods in this interface use class names. Such class |
|
51 |
* names must be given in the Java Virtual Machine internal form of |
|
52 |
* fully qualified class and interface names. For convenience '.' |
|
53 |
* and '/' are interchangeable. The internal form is defined in |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
54 |
* chapter four of |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
55 |
* <cite>The Java™ Virtual Machine Specification</cite>. |
10 | 56 |
|
57 |
* <blockquote><p> |
|
58 |
* <i>Discussion:</i> this means that the names |
|
59 |
* "java/lang.package-info", "java/lang/package-info", |
|
60 |
* "java.lang.package-info", are valid and equivalent. Compare to |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
61 |
* binary name as defined in |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
62 |
* <cite>The Java™ Language Specification</cite>, |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
63 |
* section 13.1 "The Form of a Binary". |
10 | 64 |
* </p></blockquote> |
65 |
* |
|
66 |
* <p>The case of names is significant. All names should be treated |
|
67 |
* as case-sensitive. For example, some file systems have |
|
68 |
* case-insensitive, case-aware file names. File objects representing |
|
69 |
* such files should take care to preserve case by using {@link |
|
70 |
* java.io.File#getCanonicalFile} or similar means. If the system is |
|
71 |
* not case-aware, file objects must use other means to preserve case. |
|
72 |
* |
|
73 |
* <p><em><a name="relative_name">Relative names</a>:</em> some |
|
74 |
* methods in this interface use relative names. A relative name is a |
|
75 |
* non-null, non-empty sequence of path segments separated by '/'. |
|
76 |
* '.' or '..' are invalid path segments. A valid relative name must |
|
77 |
* match the "path-rootless" rule of <a |
|
78 |
* href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>, |
|
79 |
* section 3.3. Informally, this should be true: |
|
80 |
* |
|
81 |
* <!-- URI.create(relativeName).normalize().getPath().equals(relativeName) --> |
|
82 |
* <pre> URI.{@linkplain java.net.URI#create create}(relativeName).{@linkplain java.net.URI#normalize normalize}().{@linkplain java.net.URI#getPath getPath}().equals(relativeName)</pre> |
|
83 |
* |
|
84 |
* <p>All methods in this interface might throw a SecurityException. |
|
85 |
* |
|
86 |
* <p>An object of this interface is not required to support |
|
87 |
* multi-threaded access, that is, be synchronized. However, it must |
|
88 |
* support concurrent access to different file objects created by this |
|
89 |
* object. |
|
90 |
* |
|
91 |
* <p><em>Implementation note:</em> a consequence of this requirement |
|
92 |
* is that a trivial implementation of output to a {@linkplain |
|
93 |
* java.util.jar.JarOutputStream} is not a sufficient implementation. |
|
94 |
* That is, rather than creating a JavaFileObject that returns the |
|
95 |
* JarOutputStream directly, the contents must be cached until closed |
|
96 |
* and then written to the JarOutputStream. |
|
97 |
* |
|
98 |
* <p>Unless explicitly allowed, all methods in this interface might |
|
99 |
* throw a NullPointerException if given a {@code null} argument. |
|
100 |
* |
|
101 |
* @author Peter von der Ahé |
|
102 |
* @author Jonathan Gibbons |
|
103 |
* @see JavaFileObject |
|
104 |
* @see FileObject |
|
105 |
* @since 1.6 |
|
106 |
*/ |
|
107 |
public interface JavaFileManager extends Closeable, Flushable, OptionChecker { |
|
108 |
||
109 |
/** |
|
110 |
* Interface for locations of file objects. Used by file managers |
|
111 |
* to determine where to place or search for file objects. |
|
112 |
*/ |
|
113 |
interface Location { |
|
114 |
/** |
|
25287 | 115 |
* Returns the name of this location. |
10 | 116 |
* |
117 |
* @return a name |
|
118 |
*/ |
|
119 |
String getName(); |
|
120 |
||
121 |
/** |
|
122 |
* Determines if this is an output location. An output |
|
123 |
* location is a location that is conventionally used for |
|
124 |
* output. |
|
125 |
* |
|
126 |
* @return true if this is an output location, false otherwise |
|
127 |
*/ |
|
128 |
boolean isOutputLocation(); |
|
36526 | 129 |
|
130 |
/** |
|
131 |
* Indicates if this location is expected to contain modules, |
|
132 |
* as compared to a location which contains packages and classes. |
|
133 |
* |
|
134 |
* @return true if this location is expected to contain modules |
|
135 |
* @since 9 |
|
136 |
*/ |
|
137 |
default boolean isModuleLocation() { |
|
138 |
return false; |
|
139 |
} |
|
10 | 140 |
} |
141 |
||
142 |
/** |
|
25287 | 143 |
* Returns a class loader for loading plug-ins from the given |
10 | 144 |
* location. For example, to load annotation processors, a |
145 |
* compiler will request a class loader for the {@link |
|
146 |
* StandardLocation#ANNOTATION_PROCESSOR_PATH |
|
147 |
* ANNOTATION_PROCESSOR_PATH} location. |
|
148 |
* |
|
149 |
* @param location a location |
|
150 |
* @return a class loader for the given location; or {@code null} |
|
151 |
* if loading plug-ins from the given location is disabled or if |
|
152 |
* the location is not known |
|
153 |
* @throws SecurityException if a class loader can not be created |
|
154 |
* in the current security context |
|
155 |
* @throws IllegalStateException if {@link #close} has been called |
|
156 |
* and this file manager cannot be reopened |
|
157 |
*/ |
|
158 |
ClassLoader getClassLoader(Location location); |
|
159 |
||
160 |
/** |
|
161 |
* Lists all file objects matching the given criteria in the given |
|
162 |
* location. List file objects in "subpackages" if recurse is |
|
163 |
* true. |
|
164 |
* |
|
165 |
* <p>Note: even if the given location is unknown to this file |
|
166 |
* manager, it may not return {@code null}. Also, an unknown |
|
167 |
* location may not cause an exception. |
|
168 |
* |
|
169 |
* @param location a location |
|
170 |
* @param packageName a package name |
|
171 |
* @param kinds return objects only of these kinds |
|
172 |
* @param recurse if true include "subpackages" |
|
173 |
* @return an Iterable of file objects matching the given criteria |
|
174 |
* @throws IOException if an I/O error occurred, or if {@link |
|
175 |
* #close} has been called and this file manager cannot be |
|
176 |
* reopened |
|
177 |
* @throws IllegalStateException if {@link #close} has been called |
|
178 |
* and this file manager cannot be reopened |
|
179 |
*/ |
|
180 |
Iterable<JavaFileObject> list(Location location, |
|
181 |
String packageName, |
|
182 |
Set<Kind> kinds, |
|
183 |
boolean recurse) |
|
184 |
throws IOException; |
|
185 |
||
186 |
/** |
|
187 |
* Infers a binary name of a file object based on a location. The |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
188 |
* binary name returned might not be a valid binary name according to |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5848
diff
changeset
|
189 |
* <cite>The Java™ Language Specification</cite>. |
10 | 190 |
* |
191 |
* @param location a location |
|
192 |
* @param file a file object |
|
193 |
* @return a binary name or {@code null} the file object is not |
|
194 |
* found in the given location |
|
195 |
* @throws IllegalStateException if {@link #close} has been called |
|
196 |
* and this file manager cannot be reopened |
|
197 |
*/ |
|
198 |
String inferBinaryName(Location location, JavaFileObject file); |
|
199 |
||
200 |
/** |
|
201 |
* Compares two file objects and return true if they represent the |
|
202 |
* same underlying object. |
|
203 |
* |
|
204 |
* @param a a file object |
|
205 |
* @param b a file object |
|
206 |
* @return true if the given file objects represent the same |
|
207 |
* underlying object |
|
208 |
* |
|
209 |
* @throws IllegalArgumentException if either of the arguments |
|
210 |
* were created with another file manager and this file manager |
|
211 |
* does not support foreign file objects |
|
212 |
*/ |
|
213 |
boolean isSameFile(FileObject a, FileObject b); |
|
214 |
||
215 |
/** |
|
216 |
* Handles one option. If {@code current} is an option to this |
|
217 |
* file manager it will consume any arguments to that option from |
|
218 |
* {@code remaining} and return true, otherwise return false. |
|
219 |
* |
|
220 |
* @param current current option |
|
221 |
* @param remaining remaining options |
|
222 |
* @return true if this option was handled by this file manager, |
|
223 |
* false otherwise |
|
224 |
* @throws IllegalArgumentException if this option to this file |
|
225 |
* manager is used incorrectly |
|
226 |
* @throws IllegalStateException if {@link #close} has been called |
|
227 |
* and this file manager cannot be reopened |
|
228 |
*/ |
|
229 |
boolean handleOption(String current, Iterator<String> remaining); |
|
230 |
||
231 |
/** |
|
232 |
* Determines if a location is known to this file manager. |
|
233 |
* |
|
234 |
* @param location a location |
|
235 |
* @return true if the location is known |
|
236 |
*/ |
|
237 |
boolean hasLocation(Location location); |
|
238 |
||
239 |
/** |
|
25287 | 240 |
* Returns a {@linkplain JavaFileObject file object} for input |
10 | 241 |
* representing the specified class of the specified kind in the |
242 |
* given location. |
|
243 |
* |
|
244 |
* @param location a location |
|
245 |
* @param className the name of a class |
|
246 |
* @param kind the kind of file, must be one of {@link |
|
247 |
* JavaFileObject.Kind#SOURCE SOURCE} or {@link |
|
248 |
* JavaFileObject.Kind#CLASS CLASS} |
|
249 |
* @return a file object, might return {@code null} if the |
|
250 |
* file does not exist |
|
251 |
* @throws IllegalArgumentException if the location is not known |
|
252 |
* to this file manager and the file manager does not support |
|
253 |
* unknown locations, or if the kind is not valid |
|
254 |
* @throws IOException if an I/O error occurred, or if {@link |
|
255 |
* #close} has been called and this file manager cannot be |
|
256 |
* reopened |
|
257 |
* @throws IllegalStateException if {@link #close} has been called |
|
258 |
* and this file manager cannot be reopened |
|
259 |
*/ |
|
260 |
JavaFileObject getJavaFileForInput(Location location, |
|
261 |
String className, |
|
262 |
Kind kind) |
|
263 |
throws IOException; |
|
264 |
||
265 |
/** |
|
25287 | 266 |
* Returns a {@linkplain JavaFileObject file object} for output |
10 | 267 |
* representing the specified class of the specified kind in the |
268 |
* given location. |
|
269 |
* |
|
270 |
* <p>Optionally, this file manager might consider the sibling as |
|
271 |
* a hint for where to place the output. The exact semantics of |
|
5848
c5a4ce47e780
6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
272 |
* this hint is unspecified. The JDK compiler, javac, for |
10 | 273 |
* example, will place class files in the same directories as |
274 |
* originating source files unless a class file output directory |
|
275 |
* is provided. To facilitate this behavior, javac might provide |
|
276 |
* the originating source file as sibling when calling this |
|
277 |
* method. |
|
278 |
* |
|
279 |
* @param location a location |
|
280 |
* @param className the name of a class |
|
281 |
* @param kind the kind of file, must be one of {@link |
|
282 |
* JavaFileObject.Kind#SOURCE SOURCE} or {@link |
|
283 |
* JavaFileObject.Kind#CLASS CLASS} |
|
284 |
* @param sibling a file object to be used as hint for placement; |
|
285 |
* might be {@code null} |
|
286 |
* @return a file object for output |
|
287 |
* @throws IllegalArgumentException if sibling is not known to |
|
288 |
* this file manager, or if the location is not known to this file |
|
289 |
* manager and the file manager does not support unknown |
|
290 |
* locations, or if the kind is not valid |
|
291 |
* @throws IOException if an I/O error occurred, or if {@link |
|
292 |
* #close} has been called and this file manager cannot be |
|
293 |
* reopened |
|
294 |
* @throws IllegalStateException {@link #close} has been called |
|
295 |
* and this file manager cannot be reopened |
|
296 |
*/ |
|
297 |
JavaFileObject getJavaFileForOutput(Location location, |
|
298 |
String className, |
|
299 |
Kind kind, |
|
300 |
FileObject sibling) |
|
301 |
throws IOException; |
|
302 |
||
303 |
/** |
|
25287 | 304 |
* Returns a {@linkplain FileObject file object} for input |
10 | 305 |
* representing the specified <a href="JavaFileManager.html#relative_name">relative |
306 |
* name</a> in the specified package in the given location. |
|
307 |
* |
|
308 |
* <p>If the returned object represents a {@linkplain |
|
309 |
* JavaFileObject.Kind#SOURCE source} or {@linkplain |
|
310 |
* JavaFileObject.Kind#CLASS class} file, it must be an instance |
|
311 |
* of {@link JavaFileObject}. |
|
312 |
* |
|
313 |
* <p>Informally, the file object returned by this method is |
|
314 |
* located in the concatenation of the location, package name, and |
|
315 |
* relative name. For example, to locate the properties file |
|
316 |
* "resources/compiler.properties" in the package |
|
317 |
* "com.sun.tools.javac" in the {@linkplain |
|
318 |
* StandardLocation#SOURCE_PATH SOURCE_PATH} location, this method |
|
319 |
* might be called like so: |
|
320 |
* |
|
321 |
* <pre>getFileForInput(SOURCE_PATH, "com.sun.tools.javac", "resources/compiler.properties");</pre> |
|
322 |
* |
|
323 |
* <p>If the call was executed on Windows, with SOURCE_PATH set to |
|
324 |
* <code>"C:\Documents and Settings\UncleBob\src\share\classes"</code>, |
|
325 |
* a valid result would be a file object representing the file |
|
326 |
* <code>"C:\Documents and Settings\UncleBob\src\share\classes\com\sun\tools\javac\resources\compiler.properties"</code>. |
|
327 |
* |
|
328 |
* @param location a location |
|
329 |
* @param packageName a package name |
|
330 |
* @param relativeName a relative name |
|
331 |
* @return a file object, might return {@code null} if the file |
|
332 |
* does not exist |
|
333 |
* @throws IllegalArgumentException if the location is not known |
|
334 |
* to this file manager and the file manager does not support |
|
335 |
* unknown locations, or if {@code relativeName} is not valid |
|
336 |
* @throws IOException if an I/O error occurred, or if {@link |
|
337 |
* #close} has been called and this file manager cannot be |
|
338 |
* reopened |
|
339 |
* @throws IllegalStateException if {@link #close} has been called |
|
340 |
* and this file manager cannot be reopened |
|
341 |
*/ |
|
342 |
FileObject getFileForInput(Location location, |
|
343 |
String packageName, |
|
344 |
String relativeName) |
|
345 |
throws IOException; |
|
346 |
||
347 |
/** |
|
25287 | 348 |
* Returns a {@linkplain FileObject file object} for output |
10 | 349 |
* representing the specified <a href="JavaFileManager.html#relative_name">relative |
350 |
* name</a> in the specified package in the given location. |
|
351 |
* |
|
352 |
* <p>Optionally, this file manager might consider the sibling as |
|
353 |
* a hint for where to place the output. The exact semantics of |
|
5848
c5a4ce47e780
6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
354 |
* this hint is unspecified. The JDK compiler, javac, for |
10 | 355 |
* example, will place class files in the same directories as |
356 |
* originating source files unless a class file output directory |
|
357 |
* is provided. To facilitate this behavior, javac might provide |
|
358 |
* the originating source file as sibling when calling this |
|
359 |
* method. |
|
360 |
* |
|
361 |
* <p>If the returned object represents a {@linkplain |
|
362 |
* JavaFileObject.Kind#SOURCE source} or {@linkplain |
|
363 |
* JavaFileObject.Kind#CLASS class} file, it must be an instance |
|
364 |
* of {@link JavaFileObject}. |
|
365 |
* |
|
366 |
* <p>Informally, the file object returned by this method is |
|
367 |
* located in the concatenation of the location, package name, and |
|
368 |
* relative name or next to the sibling argument. See {@link |
|
369 |
* #getFileForInput getFileForInput} for an example. |
|
370 |
* |
|
371 |
* @param location a location |
|
372 |
* @param packageName a package name |
|
373 |
* @param relativeName a relative name |
|
374 |
* @param sibling a file object to be used as hint for placement; |
|
375 |
* might be {@code null} |
|
376 |
* @return a file object |
|
377 |
* @throws IllegalArgumentException if sibling is not known to |
|
378 |
* this file manager, or if the location is not known to this file |
|
379 |
* manager and the file manager does not support unknown |
|
380 |
* locations, or if {@code relativeName} is not valid |
|
381 |
* @throws IOException if an I/O error occurred, or if {@link |
|
382 |
* #close} has been called and this file manager cannot be |
|
383 |
* reopened |
|
384 |
* @throws IllegalStateException if {@link #close} has been called |
|
385 |
* and this file manager cannot be reopened |
|
386 |
*/ |
|
387 |
FileObject getFileForOutput(Location location, |
|
388 |
String packageName, |
|
389 |
String relativeName, |
|
390 |
FileObject sibling) |
|
391 |
throws IOException; |
|
392 |
||
393 |
/** |
|
394 |
* Flushes any resources opened for output by this file manager |
|
395 |
* directly or indirectly. Flushing a closed file manager has no |
|
396 |
* effect. |
|
397 |
* |
|
398 |
* @throws IOException if an I/O error occurred |
|
399 |
* @see #close |
|
400 |
*/ |
|
36526 | 401 |
@Override |
10 | 402 |
void flush() throws IOException; |
403 |
||
404 |
/** |
|
405 |
* Releases any resources opened by this file manager directly or |
|
406 |
* indirectly. This might render this file manager useless and |
|
407 |
* the effect of subsequent calls to methods on this object or any |
|
408 |
* objects obtained through this object is undefined unless |
|
409 |
* explicitly allowed. However, closing a file manager which has |
|
410 |
* already been closed has no effect. |
|
411 |
* |
|
412 |
* @throws IOException if an I/O error occurred |
|
413 |
* @see #flush |
|
414 |
*/ |
|
36526 | 415 |
@Override |
10 | 416 |
void close() throws IOException; |
36526 | 417 |
|
418 |
/** |
|
419 |
* Gets a location for a named module within a module-oriented location. |
|
420 |
* |
|
421 |
* @param location the module-oriented location |
|
422 |
* @param moduleName the name of the module to be found |
|
423 |
* @return the location for the named module |
|
424 |
* |
|
425 |
* @throws IOException if an I/O error occurred |
|
426 |
* @throws UnsupportedOperationException if this operation if not supported by this file manager |
|
427 |
* @since 9 |
|
428 |
*/ // TODO: describe failure modes |
|
429 |
default Location getModuleLocation(Location location, String moduleName) throws IOException { |
|
430 |
throw new UnsupportedOperationException(); |
|
431 |
} |
|
432 |
||
433 |
/** |
|
434 |
* Gets a location for the module containing a specific file representing a Java |
|
435 |
* source or class. |
|
436 |
* |
|
437 |
* @param location a module-oriented location |
|
438 |
* @param fo the file |
|
439 |
* @param pkgName the package name for the class(es) defined in this file |
|
440 |
* @return the module containing the file |
|
441 |
* |
|
442 |
* @throws IOException if an I/O error occurred |
|
443 |
* @throws UnsupportedOperationException if this operation if not supported by this file manager |
|
444 |
* @since 9 |
|
445 |
*/ // TODO: describe failure modes |
|
446 |
default Location getModuleLocation(Location location, JavaFileObject fo, String pkgName) throws IOException { |
|
447 |
throw new UnsupportedOperationException(); |
|
448 |
} |
|
449 |
||
450 |
/** |
|
451 |
* Get a service loader for a specific service class from a given location. |
|
452 |
* |
|
453 |
* @param location the location |
|
454 |
* @param service the {@code Class} object of the service class |
|
455 |
* @param <S> the service class |
|
456 |
* @return a service loader for the given service class |
|
457 |
* |
|
458 |
* @throws IOException if an I/O error occurred |
|
459 |
* @throws UnsupportedOperationException if this operation if not supported by this file manager |
|
460 |
* @since 9 |
|
461 |
*/ // TODO: describe failure modes |
|
462 |
default <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws IOException { |
|
463 |
throw new UnsupportedOperationException(); |
|
464 |
} |
|
465 |
||
466 |
/** |
|
467 |
* Infer the name of the module from its location, as returned by |
|
468 |
* getModuleLocation or listModuleLocations. |
|
469 |
* |
|
470 |
* @param location a location representing a module |
|
471 |
* @return the name of the module |
|
472 |
* |
|
473 |
* @throws IOException if an I/O error occurred |
|
474 |
* @throws UnsupportedOperationException if this operation if not supported by this file manager |
|
475 |
* @since 9 |
|
476 |
*/ // TODO: describe failure modes |
|
477 |
default String inferModuleName(Location location) throws IOException { |
|
478 |
throw new UnsupportedOperationException(); |
|
479 |
} |
|
480 |
||
481 |
/** |
|
482 |
* Lists the modules in a module-oriented location. |
|
483 |
* |
|
484 |
* @param location the location for which to list the modules |
|
485 |
* @return a series of sets of locations containing modules |
|
486 |
* |
|
487 |
* @throws IOException if an I/O error occurred |
|
488 |
* @throws UnsupportedOperationException if this operation if not supported by this file manager |
|
489 |
* @since 9 |
|
490 |
*/ // TODO: describe failure modes |
|
491 |
default Iterable<Set<Location>> listModuleLocations(Location location) throws IOException { |
|
492 |
throw new UnsupportedOperationException(); |
|
493 |
} |
|
494 |
||
10 | 495 |
} |