langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
author chegar
Sun, 17 Aug 2014 15:52:32 +0100
changeset 25874 83c19f00452c
parent 25287 langtools/src/share/classes/javax/tools/StandardJavaFileManager.java@d2440361b323
child 28332 cd3ea1087d2b
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 5520
diff changeset
     2
 * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4548
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4548
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4548
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4548
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4548
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package javax.tools;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import java.io.File;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import java.io.IOException;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import java.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * File manager based on {@linkplain File java.io.File}.  A common way
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * to obtain an instance of this class is using {@linkplain
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * JavaCompiler#getStandardFileManager
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * getStandardFileManager}, for example:
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * <pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 *   JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 *   {@code DiagnosticCollector<JavaFileObject>} diagnostics =
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *       new {@code DiagnosticCollector<JavaFileObject>()};
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *   StandardJavaFileManager fm = compiler.getStandardFileManager(diagnostics, null, null);
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * </pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * This file manager creates file objects representing regular
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * {@linkplain File files},
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * {@linkplain java.util.zip.ZipEntry zip file entries}, or entries in
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * similar file system based containers.  Any file object returned
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * from a file manager implementing this interface must observe the
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 * following behavior:
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 * <ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
 *     File names need not be canonical.
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 *     For file objects representing regular files
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
 *     <ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 *       <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
 *         the method <code>{@linkplain FileObject#delete()}</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
 *         is equivalent to <code>{@linkplain File#delete()}</code>,
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
 *       </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
 *       <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
 *         the method <code>{@linkplain FileObject#getLastModified()}</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
 *         is equivalent to <code>{@linkplain File#lastModified()}</code>,
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
 *       </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
 *       <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
 *         the methods <code>{@linkplain FileObject#getCharContent(boolean)}</code>,
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
 *         <code>{@linkplain FileObject#openInputStream()}</code>, and
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
 *         <code>{@linkplain FileObject#openReader(boolean)}</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
 *         must succeed if the following would succeed (ignoring
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
 *         encoding issues):
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
 *         <blockquote>
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
 *           <pre>new {@linkplain java.io.FileInputStream#FileInputStream(File) FileInputStream}(new {@linkplain File#File(java.net.URI) File}({@linkplain FileObject fileObject}.{@linkplain FileObject#toUri() toUri}()))</pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
 *         </blockquote>
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
 *       </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
 *       <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
 *         and the methods
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
 *         <code>{@linkplain FileObject#openOutputStream()}</code>, and
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
 *         <code>{@linkplain FileObject#openWriter()}</code> must
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
 *         succeed if the following would succeed (ignoring encoding
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
 *         issues):
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
 *         <blockquote>
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
 *           <pre>new {@linkplain java.io.FileOutputStream#FileOutputStream(File) FileOutputStream}(new {@linkplain File#File(java.net.URI) File}({@linkplain FileObject fileObject}.{@linkplain FileObject#toUri() toUri}()))</pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
 *         </blockquote>
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
 *       </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
 *     </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
 *     The {@linkplain java.net.URI URI} returned from
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
 *     <code>{@linkplain FileObject#toUri()}</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
 *     <ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
 *       <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
 *         must be {@linkplain java.net.URI#isAbsolute() absolute} (have a schema), and
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
 *       </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
 *       <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
 *         must have a {@linkplain java.net.URI#normalize() normalized}
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
 *         {@linkplain java.net.URI#getPath() path component} which
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
 *         can be resolved without any process-specific context such
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
 *         as the current directory (file names must be absolute).
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
 *       </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
 *     </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
 * </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
 * According to these rules, the following URIs, for example, are
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
 * allowed:
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
 * <ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
 *     <code>file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
 *     <code>jar:///C:/Documents%20and%20Settings/UncleBob/lib/vendorA.jar!com/vendora/LibraryClass.class</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
 * </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
 * Whereas these are not (reason in parentheses):
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
 * <ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
 *     <code>file:BobsApp/Test.java</code> (the file name is relative
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
 *     and depend on the current directory)
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
 *     <code>jar:lib/vendorA.jar!com/vendora/LibraryClass.class</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
 *     (the first half of the path depends on the current directory,
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
 *     whereas the component after ! is legal)
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
 *     <code>Test.java</code> (this URI depends on the current
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
 *     directory and does not have a schema)
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
 *   <li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
 *     <code>jar:///C:/Documents%20and%20Settings/UncleBob/BobsApp/../lib/vendorA.jar!com/vendora/LibraryClass.class</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
 *     (the path is not normalized)
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
 *   </li>
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
 * </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
 * @author Peter von der Ah&eacute;
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
 * @since 1.6
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
public interface StandardJavaFileManager extends JavaFileManager {
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     * Compares two file objects and return true if they represent the
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
     * same canonical file, zip file entry, or entry in any file
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
     * system based container.
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
     * @param a a file object
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     * @param b a file object
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     * @return true if the given file objects represent the same
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
     * canonical file or zip file entry; false otherwise
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     * @throws IllegalArgumentException if either of the arguments
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     * were created with another file manager implementation
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    boolean isSameFile(FileObject a, FileObject b);
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 5520
diff changeset
   158
     * Returns file objects representing the given files.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
     * @param files a list of files
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
     * @return a list of file objects
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
     * @throws IllegalArgumentException if the list of files includes
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
     * a directory
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
    Iterable<? extends JavaFileObject> getJavaFileObjectsFromFiles(
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
        Iterable<? extends File> files);
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 5520
diff changeset
   169
     * Returns file objects representing the given files.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     * Convenience method equivalent to:
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     * <pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     *     getJavaFileObjectsFromFiles({@linkplain java.util.Arrays#asList Arrays.asList}(files))
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * </pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     * @param files an array of files
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     * @return a list of file objects
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
     * @throws IllegalArgumentException if the array of files includes
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
     * a directory
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     * @throws NullPointerException if the given array contains null
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     * elements
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    Iterable<? extends JavaFileObject> getJavaFileObjects(File... files);
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 5520
diff changeset
   186
     * Returns file objects representing the given file names.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
     * @param names a list of file names
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
     * @return a list of file objects
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
     * @throws IllegalArgumentException if the list of file names
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
     * includes a directory
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    Iterable<? extends JavaFileObject> getJavaFileObjectsFromStrings(
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        Iterable<String> names);
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 5520
diff changeset
   197
     * Returns file objects representing the given file names.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
     * Convenience method equivalent to:
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
     * <pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
     *     getJavaFileObjectsFromStrings({@linkplain java.util.Arrays#asList Arrays.asList}(names))
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
     * </pre>
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     * @param names a list of file names
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     * @return a list of file objects
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     * @throws IllegalArgumentException if the array of file names
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     * includes a directory
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     * @throws NullPointerException if the given array contains null
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     * elements
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
    Iterable<? extends JavaFileObject> getJavaFileObjects(String... names);
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     * Associates the given path with the given location.  Any
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     * previous value will be discarded.
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
     * @param location a location
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
     * @param path a list of files, if {@code null} use the default
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
     * path for this location
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
     * @see #getLocation
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
     * @throws IllegalArgumentException if location is an output
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
     * location and path does not contain exactly one element
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
     * @throws IOException if location is an output location and path
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
     * does not represent an existing directory
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
    void setLocation(Location location, Iterable<? extends File> path)
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
        throws IOException;
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 5520
diff changeset
   230
     * Returns the path associated with the given location.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
     * @param location a location
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
     * @return a list of files or {@code null} if this location has no
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
     * associated path
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
     * @see #setLocation
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    Iterable<? extends File> getLocation(Location location);
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
}