Found 345670 results in 30397 files, showing top 150 files (show more).
github.com/apache/curator:curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java: [ master, ]
75:     private final String path;
71: public class PathChildrenCache implements Closeable
151:     public PathChildrenCache(CuratorFramework client, String path, PathChildrenCacheMode mode)
165:     public PathChildrenCache(CuratorFramework client, String path, PathChildrenCacheMode mode, ThreadFactory threadFactory)
175:     public PathChildrenCache(CuratorFramework client, String path, boolean cacheData)
186:     public PathChildrenCache(CuratorFramework client, String path, boolean cacheData, ThreadFactory threadFactory)
198:     public PathChildrenCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, ThreadFactory threadFactory)
210:     public PathChildrenCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, final ExecutorService executorService)
222:     public PathChildrenCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, final CloseableExecutorService executorService)
587:     protected void ensurePath() throws Exception
60:  * <p>A utility that attempts to keep all data from all children of a ZK path locally cached. This class
61:  * will watch the ZK path, respond to update/create/delete events, pull down the data, etc. You can
95:     private static final boolean USE_EXISTS = Boolean.getBoolean("curator-path-children-cache-use-exists");
145:      * @param path   path to watch
153:         this(client, path, mode != PathChildrenCacheMode.CACHE_PATHS_ONLY, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(defaultThreadFactory),...(8 bytes skipped)...
158:      * @param path          path to watch
167:         this(client, path, mode != PathChildrenCacheMode.CACHE_PATHS_ONLY, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(threadFactory), true))...(1 bytes skipped)...
172:      * @param path      path to watch
177:         this(client, path, cacheData, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(defaultThreadFact...(13 bytes skipped)...
182:      * @param path          path to watch
188:         this(client, path, cacheData, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(threadFactory), t...(6 bytes skipped)...
193:      * @param path             path to watch
195:      * @param dataIsCompressed if true, data in the path is compressed
200:         this(client, path, cacheData, dataIsCompressed, new CloseableExecutorService(Executors.newSingleThreadExecutor(thread...(17 bytes skipped)...
205:      * @param path             path to watch
207:      * @param dataIsCompressed if true, data in the path is compressed
212:         this(client, path, cacheData, dataIsCompressed, new CloseableExecutorService(executorService));
217:      * @param path             path to watch
219:      * @param dataIsCompressed if true, data in the path is compressed
225:         this.path = PathUtils.validatePath(path);
229:         ensureContainers = new EnsureContainers(client, path);
333:         List<String> children = client.getChildren().forPath(path);
336:             String fullPath = ZKPaths.makePath(path, child);
353:      * @param fullPath full path of the node to rebuild
358:         Preconditions.checkArgument(ZKPaths.getPathAndNode(fullPath).getPath().equals(path), "Node is not part of this cache: " + fullPath);
416:      * Return the current data for the given path. There are no guarantees of accuracy. This is
417:      * merely the most recent view of the data. If there is no child with that path, <code>null</code>
420:      * @param fullPath full path to the node to check
432:      * @param fullPath the path of the node to clear
443:      * @param fullPath  the path of the node to clear
465:      * Clear out current data and begin a new query on the path
513: ...(65 bytes skipped)...n received for getChildren() and refresh has failed. Resetting ensureContainers but not refreshing. Path: [{}]", path);
518: ...(23 bytes skipped)... log.debug("KeeperException.NoNodeException received for getChildren(). Resetting ensureContainers. Path: [{}]", path);
526:         client.getChildren().usingWatcher(childrenWatcher).inBackground(callback).forPath(path);
688:             removedNodes.remove(ZKPaths.makePath(path, child));
698:             String fullPath = ZKPaths.makePath(path, name);
728:             log.debug("NoNode at path {}, removing child from initialSet", fullPath);
38: import org.apache.curator.utils.PathUtils;
79:     private final StandardListenerManager<PathChildrenCacheListener> listeners = StandardListenerManager.standard();
102:             offerOperation(new RefreshOperation(PathChildrenCache.this, RefreshMode.STANDARD));
115:                     remove(event.getPath());
119:                     offerOperation(new GetDataOperation(PathChildrenCache.this, event.getPath()));
141:     public static final ThreadFactory defaultThreadFactory = ThreadUtils.newThreadFactory("PathChildrenCache");
147:      * @deprecated use {@link #PathChildrenCache(CuratorFramework, String, boolean)} instead
161:      * @deprecated use {@link #PathChildrenCache(CuratorFramework, String, boolean, ThreadFactory)} instead
208:      * @param executorService  ExecutorService to use for the PathChildrenCache's background thread. This service should be single threaded, otherwise the cache may s...(24 bytes skipped)...
220:      * @param executorService  Closeable ExecutorService to use for the PathChildrenCache's background thread. This service should be single threaded, otherwise the cache may s...(24 bytes skipped)...
258:      * Method of priming cache on {@link PathChildrenCache#start(StartMode)}
270:          * {@link PathChildrenCache#rebuild()} will be called before
271:          * the {@link PathChildrenCache#start(StartMode)} method returns
278:          * {@link PathChildrenCacheEvent.Type#INITIALIZED} will be posted.
329:         ensurePath();
337:             internalRebuildNode(fullPath);
356:     public void rebuildNode(String fullPath) throws Exception
361:         ensurePath();
362:         internalRebuildNode(fullPath);
399:     public Listenable<PathChildrenCacheListener> getListenable()
423:     public ChildData getCurrentData(String fullPath)
425:         return currentData.get(fullPath);
434:     public void clearDataBytes(String fullPath)
436:         clearDataBytes(fullPath, -1);
447:     public boolean clearDataBytes(String fullPath, int ifVersion)
449:         ChildData data = currentData.get(fullPath);
456:                     currentData.replace(fullPath, data, new ChildData(data.getPath(), data.getStat(), null));
494:         ensurePath();
520:                         offerOperation(new RefreshOperation(PathChildrenCache.this, RefreshMode.NO_NODE_EXCEPTION));
529:     void callListeners(final PathChildrenCacheEvent event)
544:     void getDataAndStat(final String fullPath) throws Exception
555:                 applyNewData(fullPath, event.getResultCode(), event.getStat(), cacheData ? event.getData() : null);
561:             client.checkExists().usingWatcher(dataWatcher).inBackground(callback).forPath(fullPath);
568: ...(0 bytes skipped)...                client.getData().decompressed().usingWatcher(dataWatcher).inBackground(callback).forPath(fullPath);
572:                 client.getData().usingWatcher(dataWatcher).inBackground(callback).forPath(fullPath);
593:     protected void remove(String fullPath)
595:         ChildData data = currentData.remove(fullPath);
598:             offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_REMOVED, data)));
604:             localInitialSet.remove(ZKPaths.getNodeFromPath(fullPath));
619:     private void internalRebuildNode(String fullPath) throws Exception
626: ...(5 bytes skipped)...           byte[] bytes = dataIsCompressed ? client.getData().decompressed().storingStatIn(stat).forPath(fullPath) : client.getData().storingStatIn(stat).forPath(fullPath);
627:                 currentData.put(fullPath, new ChildData(fullPath, stat, bytes));
632:                 currentData.remove(fullPath);
637:             Stat stat = client.checkExists().forPath(fullPath);
640:                 currentData.put(fullPath, new ChildData(fullPath, stat, null));
645:                 currentData.remove(fullPath);
656:             offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CONNECTION_SUSPENDED, null)));
662:             offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CONNECTION_LOST, null)));
672:                 offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CONNECTION_RECONNECTED, null)));
691:         for ( String fullPath : removedNodes )
693:             remove(fullPath);
700:             if ( (mode == RefreshMode.FORCE_GET_DATA_AND_STAT) || !currentData.containsKey(fullPath) )
702:                 getDataAndStat(fullPath);
710:     private void applyNewData(String fullPath, int resultCode, Stat stat, byte[] bytes)
714:             ChildData data = new ChildData(fullPath, stat, bytes);
715:             ChildData previousData = currentData.put(fullPath, data);
718:                 offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_ADDED, data)));
722:                 offerOperation(new EventOperation(this, new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_UPDATED, data)));
724:             updateInitialSet(ZKPaths.getNodeFromPath(fullPath), data);
729:             remove(fullPath);
752:                 PathChildrenCacheEvent event = new PathChildrenCacheEvent(PathChildrenCacheEvent.Type.INITIALIZED, null)
40: import org.apache.curator.utils.ZKPaths;
android.googlesource.com/platform/external/jetbrains/JetBrainsRuntime:src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java: [ master, ]
61:     private final byte[] path;
58: final class ZipPath implements Path {
65:     ZipPath(ZipFileSystem zfs, byte[] path) {
69:     ZipPath(ZipFileSystem zfs, byte[] path, boolean normalized) {
82:     ZipPath(ZipFileSystem zfs, String path) {
146:     public ZipPath subpath(int beginIndex, int endIndex) {
168:     public ZipPath toRealPath(LinkOption... options) throws IOException {
187:     public ZipPath toAbsolutePath() {
403:     private ZipPath checkPath(Path path) {
454:     byte[] getResolvedPath() {
66:         this(zfs, path, false);
72:             this.path = path;
75:                 this.path = normalize(path);
77:                 this.path = normalize(zfs.getString(path));
84:         this.path = normalize(path);
97:         int off = path.length;
98:         if (off == 0 || off == 1 && path[0] == '/')
100:         while (--off >= 0 && path[off] != '/') {}
104:         byte[] result = new byte[path.length - off];
105:         System.arraycopy(path, off, result, 0, result.length);
111:         int off = path.length;
112:         if (off == 0 || off == 1 && path[0] == '/')
114:         while (--off >= 0 && path[off] != '/') {}
118:         System.arraycopy(path, 0, result, 0, off);
136:             len = path.length - begin;
141:         System.arraycopy(path, begin, result, 0, len);
158:             len = path.length - begin;
163:         System.arraycopy(path, begin, result, 0, len);
172:         if (resolved == path) {
191:             // add '/' before the existing path
192:             byte[] tmp = new byte[path.length + 1];
193:             System.arraycopy(path, 0, tmp, 1, path.length);
205:                            zfs.getString(toAbsolutePath().path),
216:             mlen = path.length - mbegin;
222:             olen = other.path.length - obegin;
229:             if (path[mbegin + n] != other.path[obegin + n])
237:     public Path relativize(Path other) {
241:         if (this.path.length == 0)
245:         if (this.path.length == 1 && this.path[0] == '/')
247:                                Arrays.copyOfRange(o.path, 1, o.path.length),
261:             len += (o.path.length - o.offsets[i] + 1);
273:             System.arraycopy(o.path, o.offsets[i],
275:                              o.path.length - o.offsets[i]);
286:         return path.length > 0 && path[0] == '/';
290:     public ZipPath resolve(Path other) {
292:         if (o.path.length == 0)
294:         if (o.isAbsolute() || this.path.length == 0)
296:         return resolve(o.path);
302:         byte[] tpath = this.path;
305:         if (path[tlen - 1] == '/') {
319:     public Path resolveSibling(Path other) {
321:         Path parent = getParent();
326:     public boolean startsWith(Path other) {
332:             o.path.length > this.path.length)
334:         int olast = o.path.length;
336:             if (o.path[i] != this.path[i])
340:         return o.path.length == this.path.length ||
341:                o.path[olast] == '/' ||
342:                this.path[olast + 1] == '/';
346:     public boolean endsWith(Path other) {
351:         int olast = o.path.length - 1;
352:         if (olast > 0 && o.path[olast] == '/')
354:         int last = this.path.length - 1;
355:         if (last > 0 && this.path[last] == '/')
357:         if (olast == -1)    // o.path.length == 0
363:             if (o.path[olast] != this.path[last])
366:         return o.path[olast + 1] == '/' ||
367:                last == -1 || this.path[last] == '/';
375:         if (opath[0] == '/' || this.path.length == 0)
381:     public final Path resolveSibling(String other) {
396:     public Path normalize() {
398:         if (resolved == path)    // no change
404:         Objects.requireNonNull(path, "path");
405:         if (!(path instanceof ZipPath))
407:         return (ZipPath) path;
417:             if (path.length == 0) {
418:                 // empty path has one name
421:                 while (index < path.length) {
422:                     byte c = path[index++];
425:                         while (index < path.length && path[index] != '/')
434:             while (index < path.length) {
435:                 byte c = path[index];
440:                     while (index < path.length && path[index] != '/')
451:     // resolved path for locating zip entry inside the zip file,
452:     // the result path does not contain ./ and .. components
468:     private byte[] normalize(byte[] path) {
469:         int len = path.length;
471:             return path;
474:             byte c = path[i];
476:                 return normalize(path, i);
478:                 return normalize(path, i - 1);
482:             return Arrays.copyOf(path, len - 1);
484:         return path;
487:     private byte[] normalize(byte[] path, int off) {
488:         byte[] to = new byte[path.length];
491:             to[n] = path[n];
496:         while (n < path.length) {
497:             byte c = path[n++];
503:                 throw new InvalidPathException(zfs.getString(path),
504:                                                "Path: nul character not allowed");
513:     // if zfs is NOT in utf8, normalize the path as "String"
516:     private byte[] normalize(String path) {
518:             return normalize(zfs.getBytes(path));
519:         int len = path.length();
524:             char c = path.charAt(i);
526:                 return normalize(path, i, len);
528:                 return normalize(path, i - 1, len);
532:             path = path.substring(0, len - 1);
533:         return zfs.getBytes(path);
536:     private byte[] normalize(String path, int off, int len) {
538:         to.append(path, 0, off);
541:             char c = path.charAt(off++);
547:                 throw new InvalidPathException(path,
548:                                                "Path: nul character not allowed");
560:         for (int i = 0; i < path.length; i++) {
561:             if (path[i] == (byte)'.' &&
562:                 (i + 1 == path.length || path[i + 1] == '/')) {
566:         return path;
571:         byte[] to = new byte[path.length];
579:                       (path.length - n):(offsets[i + 1] - n - 1);
580:             if (len == 1 && path[n] == (byte)'.') {
581:                 if (m == 0 && path[0] == '/')   // absolute path
585:             if (len == 2 && path[n] == '.' && path[n + 1] == '.') {
590:                 if (path[0] == '/') {  // "/../xyz" skip
597:                         to[m++] = path[n++];
601:             if (m == 0 && path[0] == '/' ||   // absolute path
607:                 to[m++] = path[n++];
616:         return zfs.getString(path);
623:             hashcode = h = Arrays.hashCode(path);
632:                compareTo((Path) obj) == 0;
636:     public int compareTo(Path other) {
638:         int len1 = this.path.length;
639:         int len2 = o.path.length;
642:         byte v1[] = this.path;
643:         byte v2[] = o.path;
678:     public Iterator<Path> iterator() {
688:             public Path next() {
690:                     Path result = getName(i);
724:     DirectoryStream<Path> newDirectoryStream(Filter<? super Path> filter)
796:         throw new NoSuchFileException(zfs.getString(path));
799:     boolean isSameFile(Path other) throws IOException {
8:  * particular file as subject to the "Classpath" exception as provided
88:     public ZipPath getRoot() {
96:     public ZipPath getFileName() {
106:         return new ZipPath(getFileSystem(), result, true);
110:     public ZipPath getParent() {
119:         return new ZipPath(getFileSystem(), result, true);
129:     public ZipPath getName(int index) {
142:         return new ZipPath(zfs, result);
164:         return new ZipPath(zfs, result);
169:         ZipPath realPath;
170:         byte[] resolved = getResolvedPath();
173:             realPath = this;
175:             realPath = new ZipPath(zfs, resolved, true);
176:             realPath.resolved = resolved;
178:         realPath.checkAccess();
179:         return realPath;
195:             return new ZipPath(zfs, tmp, true);  // normalized
212:     private boolean equalsNameAt(ZipPath other, int index) {
238:         final ZipPath o = checkPath(other);
240:             return new ZipPath(zfs, new byte[0], true);
246:             return new ZipPath(zfs,
276:         return new ZipPath(zfs, result);
291:         ZipPath o = checkPath(other);
299:     // opath is normalized, just concat
300:     private ZipPath resolve(byte[] opath) {
303:         int tlen = tpath.length;
304:         int olen = opath.length;
307:             System.arraycopy(tpath, 0, resolved, 0, tlen);
308:             System.arraycopy(opath, 0, resolved, tlen, olen);
311:             System.arraycopy(tpath, 0, resolved, 0, tlen);
313:             System.arraycopy(opath, 0, resolved, tlen + 1, olen);
315:         return new ZipPath(zfs, resolved, true);
328:         if (!(other instanceof ZipPath))
330:         final ZipPath o = (ZipPath)other;
348:         if (!(other instanceof ZipPath))
350:         final ZipPath o = (ZipPath)other;
371:     public ZipPath resolve(String other) {
372:         byte[] opath = normalize(other);
373:         if (opath.length == 0)
376:             return new ZipPath(zfs, opath, true);
377:         return resolve(opath);
382:         return resolveSibling(zfs.getPath(other));
387:         return startsWith(zfs.getPath(other));
392:         return endsWith(zfs.getPath(other));
400:         return new ZipPath(zfs, resolved, true);
460:                 r = toAbsolutePath().getResolvedPath();
630:                obj instanceof ZipPath &&
631:                this.zfs == ((ZipPath)obj).zfs &&
637:         final ZipPath o = checkPath(other);
710:         zfs.createDirectory(getResolvedPath(), attrs);
721:         return zfs.newInputStream(getResolvedPath());
731:         zfs.deleteFile(getResolvedPath(), true);
735:         zfs.deleteFile(getResolvedPath(), false);
740:         ZipFileAttributes zfas = zfs.getFileAttributes(getResolvedPath());
768:         zfs.setTimes(getResolvedPath(), mtime, atime, ctime);
806:         ((ZipPath)other).checkAccess();
807:         return Arrays.equals(this.getResolvedPath(),
808:                              ((ZipPath)other).getResolvedPath());
815:         return zfs.newByteChannel(getResolvedPath(), options, attrs);
823:         return zfs.newFileChannel(getResolvedPath(), options, attrs);
843:         zfs.checkAccess(getResolvedPath());
851:             return zfs.exists(getResolvedPath());
859:             return zfs.newOutputStream(getResolvedPath(),
861:         return zfs.newOutputStream(getResolvedPath(), options);
864:     void move(ZipPath target, CopyOption... options)
870:                          getResolvedPath(), target.getResolvedPath(),
878:     void copy(ZipPath target, CopyOption... options)
883:                          getResolvedPath(), target.getResolvedPath(),
889:     private void copyToTarget(ZipPath target, CopyOption... options)
921:             InputStream is = zfs.newInputStream(getResolvedPath());
github.com/bazelbuild/rules_closure:java/io/bazel/rules/closure/Webpath.java: [ master, ]
72:   private final String path;
55:   private static final Webpath EMPTY_PATH = new Webpath("");
56:   private static final Webpath ROOT_PATH = new Webpath(ROOT);
49: public final class Webpath implements CharSequence, Comparable<Webpath> {
76:   private Webpath(String path) {
170:   public Webpath subpath(int beginIndex, int endIndex) {
393:   public Webpath toAbsolutePath(Webpath currentWorkingDirectory) {
399:   public Webpath toAbsolutePath() {
34:  * Web server path.
36:  * <p>This class is a de facto implementation of the {@link java.nio.file.Path} API. That interface
62:   /** Returns new path of {@code first}. */
63:   public static Webpath get(String path) {
64:     if (path.isEmpty()) {
65:       return EMPTY_PATH;
66:     } else if (isRootInternal(path)) {
67:       return ROOT_PATH;
69:     return new Webpath(path);
77:     this.path = checkNotNull(path);
82:     return isRootInternal(path);
85:   private static boolean isRootInternal(String path) {
86:     return path.length() == 1 && path.charAt(0) == SEPARATOR;
89:   /** Returns {@code true} if path starts with {@code separator}. */
91:     return isAbsoluteInternal(path);
94:   private static boolean isAbsoluteInternal(String path) {
95:     return !path.isEmpty() && path.charAt(0) == SEPARATOR;
98:   /** Returns {@code true} if path ends with {@code separator}. */
100:     return hasTrailingSeparatorInternal(path);
103:   private static boolean hasTrailingSeparatorInternal(CharSequence path) {
104:     return path.length() != 0 && path.charAt(path.length() - 1) == SEPARATOR;
107:   /** Returns {@code true} if path ends with a trailing slash, or would after normalization. */
109:     int length = path.length();
110:     return path.isEmpty()
111:         || path.charAt(length - 1) == SEPARATOR
112:         || (path.endsWith(".") && (length == 1 || path.charAt(length - 2) == SEPARATOR))
113:         || (path.endsWith("..") && (length == 2 || path.charAt(length - 3) == SEPARATOR));
117:    * Returns last component in {@code path}.
119:    * @see java.nio.file.Path#getFileName()
123:     if (path.isEmpty()) {
124:       return EMPTY_PATH;
130:       return parts.size() == 1 && path.equals(last) ? this : new Webpath(last);
137:    * @see java.nio.file.Path#getParent()
141:     if (path.isEmpty() || isRoot()) {
146:             ? path.lastIndexOf(SEPARATOR, path.length() - 2)
147:             : path.lastIndexOf(SEPARATOR);
149:       return isAbsolute() ? ROOT_PATH : null;
151:       return new Webpath(path.substring(0, index + 1));
156:    * Returns root component if an absolute path, otherwise {@code null}.
158:    * @see java.nio.file.Path#getRoot()
162:     return isAbsolute() ? ROOT_PATH : null;
166:    * Returns specified range of sub-components in path joined together.
168:    * @see java.nio.file.Path#subpath(int, int)
171:     if (path.isEmpty() && beginIndex == 0 && endIndex == 1) {
185:    * Returns number of components in {@code path}.
187:    * @see java.nio.file.Path#getNameCount()
190:     if (path.isEmpty()) {
200:    * Returns component in {@code path} at {@code index}.
202:    * @see java.nio.file.Path#getName(int)
205:     if (path.isEmpty()) {
217:    * Returns path without extra separators or {@code .} and {@code ..}, preserving trailing slash.
219:    * @see java.nio.file.Path#normalize()
228:       index = path.indexOf(SEPARATOR, mark);
229:       String part = path.substring(mark, index == -1 ? path.length() : index + 1);
280:    * Returns {@code other} appended to {@code path}.
282:    * @see java.nio.file.Path#resolve(java.nio.file.Path)
285:     if (other.path.isEmpty()) {
290:       return new Webpath(path + other.path);
292:       return new Webpath(path + SEPARATOR + other.path);
297:    * Returns {@code other} resolved against parent of {@code path}.
299:    * @see java.nio.file.Path#resolveSibling(java.nio.file.Path)
307:   /** Returns absolute path of {@code reference} relative to {@code file}. */
313:    * Returns {@code other} made relative to {@code path}.
315:    * @see java.nio.file.Path#relativize(java.nio.file.Path)
318:     checkArgument(isAbsolute() == other.isAbsolute(), "'other' is different type of Path");
319:     if (path.isEmpty()) {
331:     StringBuilder result = new StringBuilder(path.length() + other.path.length());
348:    * Returns {@code true} if {@code path} starts with {@code other}.
350:    * @see java.nio.file.Path#startsWith(java.nio.file.Path)
355:     if (other.path.length() > me.path.length()) {
359:     } else if (!me.path.isEmpty() && other.path.isEmpty()) {
375:    * Returns {@code true} if {@code path} ends with {@code other}.
377:    * @see java.nio.file.Path#endsWith(java.nio.file.Path)
382:     if (other.path.length() > me.path.length()) {
384:     } else if (!me.path.isEmpty() && other.path.isEmpty()) {
387:       return me.isAbsolute() && me.path.equals(other.path);
392:   /** Converts relative path to an absolute path. */
398:   /** Returns {@code toAbsolutePath(ROOT_PATH)}. */
400:     return toAbsolutePath(ROOT_PATH);
403:   /** Removes beginning separator from path, if an absolute path. */
405:     return isAbsolute() ? new Webpath(path.substring(1)) : this;
408:   /** Adds trailing separator to path, if it isn't present. */
410:     return hasTrailingSeparator() ? this : new Webpath(path + SEPARATOR);
413:   /** Removes trailing separator from path, unless it's root. */
416:       return new Webpath(path.substring(0, path.length() - 1));
422:   /** Splits path into components, excluding separators and empty strings. */
427:   /** Splits path into components in reverse, excluding separators and empty strings. */
435:    * @see java.nio.file.Path#compareTo(java.nio.file.Path)
481:     String path2 = ((Webpath) other).path;
485:       if (i == path.length()) {
486:         return i2 == path2.length();
488:       if (i2 == path2.length()) {
491:       char c = path.charAt(i++);
493:         while (i < path.length() && path.charAt(i) == SEPARATOR) {
497:       char c2 = path2.charAt(i2++);
502:         while (i2 < path2.length() && path2.charAt(i2) == SEPARATOR) {
515:       for (int i = 0; i < path.length(); i++) {
516:         char c = path.charAt(i);
527:   /** Returns path as a string. */
530:     return path;
535:     return path.length();
540:     return path.charAt(index);
545:     return path.subSequence(start, end);
548:   /** Returns {@code true} if this path is an empty string. */
550:     return path.isEmpty();
553:   /** Returns list of path components, excluding slashes. */
559:             path.isEmpty() || isRoot()
561:                 : SPLITTER.splitToList(path));
37:  * is not formally implemented because it would not be desirable to have web paths accidentally
38:  * intermingle with file system paths.
40:  * <p>This implementation is almost identical to {@code sun.nio.fs.UnixPath}. The main difference is
122:   public Webpath getFileName() {
140:   public Webpath getParent() {
161:   public Webpath getRoot() {
181:     return new Webpath(JOINER.join(subList));
204:   public Webpath getName(int index) {
210:       return new Webpath(getParts().get(index));
221:   public Webpath normalize() {
276:     return new Webpath(result.toString());
284:   public Webpath resolve(Webpath other) {
301:   public Webpath resolveSibling(Webpath other) {
303:     Webpath parent = getParent();
308:   public Webpath lookup(Webpath reference) {
317:   public Webpath relativize(Webpath other) {
344:     return new Webpath(result.toString());
352:   public boolean startsWith(Webpath other) {
353:     Webpath me = removeTrailingSeparator();
379:   public boolean endsWith(Webpath other) {
380:     Webpath me = removeTrailingSeparator();
404:   public Webpath removeBeginningSeparator() {
409:   public Webpath addTrailingSeparator() {
414:   public Webpath removeTrailingSeparator() {
433:    * Compares two paths lexicographically for ordering.
438:   public int compareTo(Webpath other) {
478:     if (!(other instanceof Webpath) || hashCode() != other.hashCode()) {
gerrit.googlesource.com/gitiles:java/com/google/gitiles/PathServlet.java: [ master, ]
426:     private final String path;
66: public class PathServlet extends BaseServlet {
118:   public PathServlet(GitilesAccess.Factory accessFactory, Renderer renderer, GitilesUrls urls) {
292:     private final byte[] pathRaw;
360:     private static WalkResult recursivePath(RevWalk rw, GitilesView view) throws IOException {
390:     private static WalkResult forPath(RevWalk rw, GitilesView view, boolean recursive)
64: /** Serves an HTML page with detailed information about a path within a tree. */
69:   static final String MODE_HEADER = "X-Gitiles-Path-Mode";
222:         out.write(Constants.encode(QuotedString.GIT_PATH.quote(wr.tw.getNameString())));
255:                   wr.id, view.getRepositoryName(), view.getRevision().getName(), wr.path),
362:       String path = view.getPathPart();
365:       if (!path.isEmpty()) {
366:         try (TreeWalk toRoot = TreeWalk.forPath(rw.getObjectReader(), path, root)) {
387:       return new WalkResult(tw, path, root, root, FileType.TREE, ImmutableList.<Boolean>of());
397:       String path = view.getPathPart();
401:         if (path.isEmpty()) {
402:           return new WalkResult(tw, path, root, root, FileType.TREE, ImmutableList.<Boolean>of());
404:         AutoDiveFilter f = new AutoDiveFilter(path);
414:             return new WalkResult(tw, path, root, id, type, f.hasSingleTree);
434:         String path,
440:       this.path = path;
463:       byte[] path = Constants.encode(view.getPathPart());
465:       CanonicalTreeParser child = getOnlyChildSubtree(reader, wr.id, path);
468:           path = new byte[child.getEntryPathLength()];
469:           System.arraycopy(child.getEntryPathBuffer(), 0, path, 0, child.getEntryPathLength());
470:           CanonicalTreeParser next = getOnlyChildSubtree(reader, child.getEntryObjectId(), path);
477:             GitilesView.path()
513:     Map<String, ?> data = new BlobSoyData(wr.getObjectReader(), view).toSoyData(wr.path, wr.id);
555:             GitilesView.path().copyFrom(view).setPathPart(dirname(view.getPathPart())).build(),
575:   private static String dirname(String path) {
576:     while (path.charAt(path.length() - 1) == '/') {
577:       path = path.substring(0, path.length() - 1);
579:     int lastSlash = path.lastIndexOf('/');
581:       return path.substring(0, lastSlash - 1);
129:         WalkResult wr = WalkResult.forPath(rw, view, false)) {
161:         WalkResult wr = WalkResult.forPath(rw, view, false)) {
245:         WalkResult wr = WalkResult.forPath(rw, view, recursive)) {
296:     AutoDiveFilter(String pathStr) {
298:       pathRaw = Constants.encode(pathStr);
306:       int cmp = tw.isPathPrefix(pathRaw, pathRaw.length);
337:       return Bytes.indexOf(pathRaw, (byte) '/') >= 0;
347:         done = pathRaw.length == tw.getPathLength();
393:         return recursivePath(rw, view);
489:         "gitiles.pathDetail",
518:         "gitiles.pathDetail",
544:           "gitiles.pathDetail",
567:         "gitiles.pathDetail",
596:         SubmoduleWalk.forPath(ServletUtils.getRepository(req), wr.root, view.getPathPart())) {
599:         String moduleRepo = PathUtil.simplifyPathUpToRoot(modulesUrl, view.getRepositoryName());
624:         "gitiles.pathDetail",
479:                 .setPathPart(
480:                     RawParseUtils.decode(child.getEntryPathBuffer(), 0, child.getEntryPathLength()))
491:             "title", !view.getPathPart().isEmpty() ? view.getPathPart() : "/",
520:             "title", ViewFilter.getView(req).getPathPart(),
546:               "title", ViewFilter.getView(req).getPathPart(),
557:     data.put("title", view.getPathPart());
569:             "title", ViewFilter.getView(req).getPathPart(),
626:             "title", view.getPathPart(),
github.com/google/gitiles:java/com/google/gitiles/PathServlet.java: [ master, ] Duplicate result
github.com/google/fest:third_party/fest-swing/src/main/java/org/fest/swing/fixture/JTreePathFixture.java: [ master, ]
35:   private final String path;
212:   public @Nonnull String path() {
33: public class JTreePathFixture implements JTreeNodeFixture<JTreePathFixture> {
43:   protected JTreePathFixture(@Nonnull JTreeFixture tree, @Nonnull String path) {
40:    * @param tree handles the {@code JTree} containing the node with the given path.
41:    * @param path the given path.
45:     this.path = path;
54:    * @throws ActionFailedException if this method fails to expand the path.
59:     tree.expandPath(path());
69:    * @throws ActionFailedException if this method fails to collapse the path.
74:     tree.collapsePath(path());
88:     tree.selectPath(path());
101:     tree.clickPath(path());
116:     tree.clickPath(path(), button);
131:     tree.clickPath(path(), mouseClickInfo);
144:     tree.doubleClickPath(path());
157:     tree.rightClickPath(path());
170:     tree.drag(path());
184:     tree.drop(path());
198:     return tree.showPopupMenuAt(path());
206:     return tree.valueAt(path());
210:    * @return the path of this fixture's node.
213:     return path;
27:  * Supports functional testing of single nodes, referenced by their paths, in {@code JTree}s.
38:    * Creates a new {@link JTreePathFixture}.
58:   public @Nonnull JTreePathFixture expand() {
73:   public @Nonnull JTreePathFixture collapse() {
87:   public @Nonnull JTreePathFixture select() {
100:   public @Nonnull JTreePathFixture click() {
115:   public @Nonnull JTreePathFixture click(@Nonnull MouseButton button) {
130:   public @Nonnull JTreePathFixture click(@Nonnull MouseClickInfo mouseClickInfo) {
143:   public @Nonnull JTreePathFixture doubleClick() {
156:   public @Nonnull JTreePathFixture rightClick() {
169:   public @Nonnull JTreePathFixture drag() {
183:   public @Nonnull JTreePathFixture drop() {
github.com/apache/incubator-retired-hdt:org.apache.hdt.dfs.core/src/org/apache/hdt/dfs/core/DFSPath.java: [ master, ]
45:   protected final Path path;
37: public abstract class DFSPath implements DFSContent {
61:   public DFSPath(DFSContentProvider provider, HadoopCluster location)
76:   protected DFSPath(DFSPath parent, Path path) {
134:   public Path getPath() {
29: import org.apache.hadoop.fs.Path;
35:  * DFS Path handling for DFS
55:    * Create a path representation for the given location in the given viewer
58:    * @param path
66:     this.path = new Path("/");
71:    * Create a sub-path representation for the given parent path
74:    * @param path
81:     this.path = path;
91:     if (path.equals("/")) {
95:       return this.path.getName();
104:       getDFS().delete(this.path, true);
109:           "Unable to delete file \"" + this.path + "\"\n" + e);
135:     return this.path;
47:   protected final DFSPath parent;
52:   static Logger log = Logger.getLogger(DFSPath.class.getName());
113:   public DFSPath getParent() {
127:    * Copy the DfsPath to the given local directory
gerrit.googlesource.com/plugins/maintainer:src/main/java/io/fd/maintainer/plugin/parser/ComponentPath.java: [ master, ]
29:     private final String path;
27: public class ComponentPath {
31:     public ComponentPath(final String path) {
35:     public String getPath() {
89:     private MatchLevel matchPathsAsDirectChild(final String[] componentPath, final String[] matchedPath) {
32:         this.path = path;
36:         return path;
39:     public MatchLevel matchAgainst(final String path) {
41:         if (path == null) {
45:         MatchLevel matchLevel = this.path.equals(path)
51:             final int indexOfWildcard = this.path.indexOf("*");
54:                 final String wildcardLess = this.path.replace(this.path.substring(indexOfWildcard), "");
55:                 if (path.contains(wildcardLess)) {
56:                     matchLevel = this.path.equals(wildcardLess)
57:                             // if path does not have wildcard, its partial match
62:                     final int extensionStart = this.path.lastIndexOf(".");
63:                     final String componentExtension = extension(extensionStart, this.path);
67:                         if (-1 != extensionStart && extension(path).equals(componentExtension)) {
76:                 // not a wildcard path ,therefore attempts match it as direct child
77:                 final String[] componentPathParts = this.path.split("/");
78:                 final String[] matchedPathParts = path.split("/");
102:     private String extension(final int extensionStart, final String path) {
106:         return path.substring(extensionStart + 1);
109:     private String extension(final String path) {
110:         return extension(path.lastIndexOf("."), path);
116:                 "path='" + path + '\'' +
131:         return path != null
132:                 ? path.equals(that.path)
133:                 : that.path == null;
138:         return path != null
139:                 ? path.hashCode()
145:         WILDCARD_WITH_EXTENSION(3),// matches wildcarded path with extension for ex.: foo/bar/*.mk
146:         PARTIAL(2),// matches part of the path
147:         WILDCARD_ONLY(1),// matches wildcarded path for ex.: foo/bar/*
19: import static io.fd.maintainer.plugin.parser.ComponentPath.MatchLevel.FULL;
20: import static io.fd.maintainer.plugin.parser.ComponentPath.MatchLevel.NONE;
21: import static io.fd.maintainer.plugin.parser.ComponentPath.MatchLevel.PARTIAL;
22: import static io.fd.maintainer.plugin.parser.ComponentPath.MatchLevel.WILDCARD_ONLY;
23: import static io.fd.maintainer.plugin.parser.ComponentPath.MatchLevel.WILDCARD_WITH_EXTENSION;
90:         for (int i = 0; i < componentPath.length; i++) {
91:             if (componentPath[i].equals(matchedPath[i])) {
115:         return "ComponentPath{" +
129:         final ComponentPath that = (ComponentPath) o;
80:                 matchLevel = matchedPathParts.length - componentPathParts.length > 1
83:                         : matchPathsAsDirectChild(componentPathParts, matchedPathParts);
github.com/bazelbuild/eclipse:java/com/google/devtools/bazel/e4b/classpath/BazelClasspathContainer.java: [ master, ]
48:   private final IPath path;
15: package com.google.devtools.bazel.e4b.classpath;
60:   private boolean isSourcePath(String path) throws JavaModelException, BackingStoreException {
137:   private static IPath getJarIPath(File execRoot, String file) {
156:   public IPath getPath() {
45: public class BazelClasspathContainer implements IClasspathContainer {
52:   public BazelClasspathContainer(IPath path, IJavaProject project)
93:   private boolean isSourceInPaths(List<String> sources)
104:   public IClasspathEntry[] getClasspathEntries() {
125:   private IClasspathEntry[] jarsToClasspathEntries(Set<Jars> jars) {
20: import java.nio.file.Path;
55:     this.path = path;
61:     Path pp = new File(instance.getWorkspaceRoot().toString() + File.separator + path).toPath();
81:   private boolean matchPatterns(Path path, IPath[] patterns) {
85:         if (matcher.matches(path)) {
141:     File path = new File(execRoot, file);
142:     return org.eclipse.core.runtime.Path.fromOSString(path.toString());
157:     return path;
21: import java.nio.file.PathMatcher;
30: import org.eclipse.core.runtime.IPath;
63:     for (IClasspathEntry entry : project.getRawClasspath()) {
65:         IResource res = root.findMember(entry.getPath());
69:             IPath[] inclusionPatterns = entry.getInclusionPatterns();
83:       for (IPath p : patterns) {
84:         PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + p.toOSString());
96:       if (isSourcePath(s)) {
117:       Activator.error("Unable to compute classpath containers entries.", e);
130:       entries[i] = JavaCore.newLibraryEntry(getJarIPath(execRoot, j.getJar()),
131:           getJarIPath(execRoot, j.getSrcJar()), null);
147:     return "Bazel Classpath Container";
31: import org.eclipse.jdt.core.IClasspathContainer;
32: import org.eclipse.jdt.core.IClasspathEntry;
64:       if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
111:         if (!isSourceInPaths(s.getSources())) {
115:       return jarsToClasspathEntries(jars);
118:       return new IClasspathEntry[] {};
121:       return new IClasspathEntry[] {};
126:     IClasspathEntry[] entries = new IClasspathEntry[jars.size()];
android.googlesource.com/platform/dalvik:dx/src/com/android/multidex/Path.java: [ master, ]
32: class Path {
53:     Path(String definition) throws IOException {
34:     static ClassPathElement getClassPathElement(File file)
95:     synchronized DirectClassFile getClass(String path) throws FileNotFoundException {
99:                 InputStream in = element.open(path);
103:                     classFile = new DirectClassFile(bytes, path, false);
114:             throw new FileNotFoundException("File \"" + path + "\" not found");
41:             throw new IOException("\"" + file.getPath() +
44:             throw new FileNotFoundException("File \"" + file.getPath() + "\" not found");
55:         for (String filePath : definition.split(Pattern.quote(File.pathSeparator))) {
57:                 addElement(getClassPathElement(new File(filePath)));
59:                 throw new IOException("Wrong classpath: " + e.getMessage(), e);
37:             return new FolderPathElement(file);
39:             return new ArchivePathElement(new ZipFile(file));
48:     List<ClassPathElement> elements = new ArrayList<ClassPathElement>();
86:     Iterable<ClassPathElement> getElements() {
90:     private void addElement(ClassPathElement element) {
97:         for (ClassPathElement element : elements) {
github.com/google/climb-tracker:climblib/src/main/java/fr/steren/climblib/Path.java: [ master, ]
15: public class Path {
android.googlesource.com/platform/gdk:samples/PhotoEditor/src/com/android/photoeditor/actions/ColorPath.java: [ master, ]
30:     private final Path path;
37:     public Path path() {
27: public class ColorPath {
32:     public ColorPath(int color, Path path) {
22: import android.graphics.Path;
25:  * Colored path that could be painted on canvas.
34:         this.path = path;
38:         return path;
43:         canvas.drawPath(path, paint);
47:      * Creates a paint to draw color paths.
github.com/GoogleCloudPlatform/qupath-chcapi-extension:src/main/java/com/quantumsoft/qupathcloud/imageserver/StubImageServer.java: [ master, ]
36:   private String path;
39:   public String getPath() {
53:   public void setPath(String path) {
16: package com.quantumsoft.qupathcloud.imageserver;
31:  * Stub image server which contains only displayed image name and path.
40:     return path;
49:    * Sets path.
51:    * @param path the path
54:     this.path = path;
22: import qupath.lib.images.servers.ImageChannel;
23: import qupath.lib.images.servers.ImageServer;
24: import qupath.lib.images.servers.ImageServerMetadata;
25: import qupath.lib.images.servers.PixelType;
26: import qupath.lib.images.servers.TileRequest;
27: import qupath.lib.images.servers.TileRequestManager;
28: import qupath.lib.regions.RegionRequest;
github.com/GoogleCloudPlatform/endpoints-codelab-android:todoTxtTouch/src/main/java/com/todotxt/todotxttouch/util/Path.java: [ master, ]
28: public class Path {
44:     public static String parentPath(String path) {
29:     public static String fileName(String path) {
30:         if (!Strings.isBlank(path)) {
32:             if (path.endsWith("/")) {
33:                 path = path.substring(0, path.length() - 1);
36:             int ind = path.lastIndexOf('/');
38:             return path.substring(ind + 1, path.length());
46:         if (Strings.isBlank(path) || path.equals("/")) {
49:             if (path.endsWith("/")) {
50:                 path = path.substring(0, path.length() - 1);
53:             int ind = path.lastIndexOf('/');
56:                 // strip the last slash, unless the entire path is '/'
60:             return path.substring(0, ind);
github.com/googleapis/java-storage-nio:google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/UnixPath.java: [ master, ]
65:   private final String path;
57:   public static final UnixPath EMPTY_PATH = new UnixPath(false, "");
58:   public static final UnixPath ROOT_PATH = new UnixPath(false, ROOT);
50: final class UnixPath implements CharSequence {
69:   private UnixPath(boolean permitEmptyComponents, String path) {
75:   public static UnixPath getPath(boolean permitEmptyComponents, String path) {
91:   public static UnixPath getPath(boolean permitEmptyComponents, String first, String... more) {
208:   public UnixPath subpath(int beginIndex, int endIndex) {
417:   public UnixPath toAbsolutePath(UnixPath currentWorkingDirectory) {
423:   public UnixPath toAbsolutePath() {
36:  * Unix file system path.
38:  * <p>This class is helpful for writing {@link java.nio.file.Path Path} implementations.
42:  * preserve trailing backslashes, in order to ensure the path will continue to be recognized as a
70:     this.path = checkNotNull(path);
74:   /** Returns new path of {@code first}. */
76:     if (path.isEmpty()) {
77:       return EMPTY_PATH;
78:     } else if (isRootInternal(path)) {
79:       return ROOT_PATH;
81:       return new UnixPath(permitEmptyComponents, path);
86:    * Returns new path of {@code first} with {@code more} components resolved against it.
118:     return isRootInternal(path);
121:   private static boolean isRootInternal(String path) {
122:     return path.length() == 1 && path.charAt(0) == SEPARATOR;
125:   /** Returns {@code true} if path starts with {@code separator}. */
127:     return isAbsoluteInternal(path);
130:   private static boolean isAbsoluteInternal(String path) {
131:     return !path.isEmpty() && path.charAt(0) == SEPARATOR;
134:   /** Returns {@code true} if path ends with {@code separator}. */
136:     return hasTrailingSeparatorInternal(path);
139:   private static boolean hasTrailingSeparatorInternal(CharSequence path) {
140:     return path.length() != 0 && path.charAt(path.length() - 1) == SEPARATOR;
143:   /** Returns {@code true} if path ends with a trailing slash, or would after normalization. */
145:     int length = path.length();
146:     return path.isEmpty()
147:         || path.charAt(length - 1) == SEPARATOR
148:         || path.endsWith(".") && (length == 1 || path.charAt(length - 2) == SEPARATOR)
149:         || path.endsWith("..") && (length == 2 || path.charAt(length - 3) == SEPARATOR);
153:    * Returns last component in {@code path}.
155:    * @see java.nio.file.Path#getFileName()
159:     if (path.isEmpty()) {
160:       return EMPTY_PATH;
166:       return parts.size() == 1 && path.equals(last)
175:    * @see java.nio.file.Path#getParent()
179:     if (path.isEmpty() || isRoot()) {
184:             ? path.lastIndexOf(SEPARATOR, path.length() - 2)
185:             : path.lastIndexOf(SEPARATOR);
187:       return isAbsolute() ? ROOT_PATH : null;
189:       return new UnixPath(permitEmptyComponents, path.substring(0, index + 1));
194:    * Returns root component if an absolute path, otherwise {@code null}.
196:    * @see java.nio.file.Path#getRoot()
200:     return isAbsolute() ? ROOT_PATH : null;
204:    * Returns specified range of sub-components in path joined together.
206:    * @see java.nio.file.Path#subpath(int, int)
209:     if (path.isEmpty() && beginIndex == 0 && endIndex == 1) {
223:    * Returns number of components in {@code path}.
225:    * @see java.nio.file.Path#getNameCount()
228:     if (path.isEmpty()) {
238:    * Returns component in {@code path} at {@code index}.
240:    * @see java.nio.file.Path#getName(int)
243:     if (path.isEmpty()) {
254:    * Returns path without extra separators or {@code .} and {@code ..}, preserving trailing slash.
256:    * @see java.nio.file.Path#normalize()
265:       index = path.indexOf(SEPARATOR, mark);
266:       String part = path.substring(mark, index == -1 ? path.length() : index + 1);
300:    * Returns {@code other} appended to {@code path}.
302:    * @see java.nio.file.Path#resolve(java.nio.file.Path)
305:     if (other.path.isEmpty()) {
310:       return new UnixPath(permitEmptyComponents, path + other.path);
312:       return new UnixPath(permitEmptyComponents, path + SEPARATOR + other.path);
317:    * Returns {@code other} resolved against parent of {@code path}.
319:    * @see java.nio.file.Path#resolveSibling(java.nio.file.Path)
328:    * Returns {@code other} made relative to {@code path}.
330:    * @see java.nio.file.Path#relativize(java.nio.file.Path)
333:     checkArgument(isAbsolute() == other.isAbsolute(), "'other' is different type of Path");
334:     if (path.isEmpty()) {
346:     StringBuilder result = new StringBuilder(path.length() + other.path.length());
363:    * Returns {@code true} if {@code path} starts with {@code other}.
365:    * @see java.nio.file.Path#startsWith(java.nio.file.Path)
370:     if (other.path.length() > me.path.length()) {
374:     } else if (!me.path.isEmpty() && other.path.isEmpty()) {
390:    * Returns {@code true} if {@code path} ends with {@code other}.
392:    * @see java.nio.file.Path#endsWith(java.nio.file.Path)
397:     if (other.path.length() > me.path.length()) {
399:     } else if (!me.path.isEmpty() && other.path.isEmpty()) {
402:       return me.isAbsolute() && me.path.equals(other.path);
410:    * @see java.nio.file.Path#compareTo(java.nio.file.Path)
416:   /** Converts relative path to an absolute path. */
422:   /** Returns {@code toAbsolutePath(ROOT_PATH)}. */
424:     return toAbsolutePath(ROOT_PATH);
427:   /** Removes beginning separator from path, if an absolute path. */
429:     return isAbsolute() ? new UnixPath(permitEmptyComponents, path.substring(1)) : this;
432:   /** Adds trailing separator to path, if it isn't present. */
434:     return hasTrailingSeparator() ? this : new UnixPath(permitEmptyComponents, path + SEPARATOR);
437:   /** Removes trailing separator from path, unless it's root. */
440:       return new UnixPath(permitEmptyComponents, path.substring(0, path.length() - 1));
446:   /** Splits path into components, excluding separators and empty strings. */
451:   /** Splits path into components in reverse, excluding separators and empty strings. */
458:     return this == other || other instanceof UnixPath && path.equals(((UnixPath) other).path);
463:     return path.hashCode();
466:   /** Returns path as a string. */
469:     return path;
474:     return path.length();
479:     return path.charAt(index);
484:     return path.subSequence(start, end);
487:   /** Returns {@code true} if this path is an empty string. */
489:     return path.isEmpty();
492:   /** Returns list of path components, excluding slashes. */
498:             path.isEmpty() || isRoot() ? Collections.<String>emptyList() : createParts());
504:           path.charAt(0) == SEPARATOR ? path.substring(1) : path);
506:       return SPLITTER.splitToList(path);
40:  * <p>This implementation behaves almost identically to {@code sun.nio.fs.UnixPath}. The only
41:  * difference is that some methods (like {@link #relativize(UnixPath)} go to greater lengths to
88:    * @see #resolve(UnixPath)
89:    * @see java.nio.file.FileSystem#getPath(String, String...)
93:       return getPath(permitEmptyComponents, first);
102:           return new UnixPath(permitEmptyComponents, part);
113:     return new UnixPath(permitEmptyComponents, builder.toString());
158:   public UnixPath getFileName() {
168:           : new UnixPath(permitEmptyComponents, last);
178:   public UnixPath getParent() {
199:   public UnixPath getRoot() {
219:     return new UnixPath(permitEmptyComponents, JOINER.join(subList));
242:   public UnixPath getName(int index) {
247:       return new UnixPath(permitEmptyComponents, getParts().get(index));
258:   public UnixPath normalize() {
296:     return new UnixPath(permitEmptyComponents, result.toString());
304:   public UnixPath resolve(UnixPath other) {
321:   public UnixPath resolveSibling(UnixPath other) {
323:     UnixPath parent = getParent();
332:   public UnixPath relativize(UnixPath other) {
359:     return new UnixPath(permitEmptyComponents, result.toString());
367:   public boolean startsWith(UnixPath other) {
368:     UnixPath me = removeTrailingSeparator();
394:   public boolean endsWith(UnixPath other) {
395:     UnixPath me = removeTrailingSeparator();
408:    * Compares two paths lexicographically for ordering.
412:   public int compareTo(UnixPath other) {
428:   public UnixPath removeBeginningSeparator() {
433:   public UnixPath addTrailingSeparator() {
438:   public UnixPath removeTrailingSeparator() {
github.com/googleapis/java-storage-nio:google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStoragePath.java: [ master, ]
55:   private final UnixPath path;
49: public final class CloudStoragePath implements Path {
57:   private CloudStoragePath(CloudStorageFileSystem fileSystem, UnixPath path) {
62:   static CloudStoragePath getPath(CloudStorageFileSystem fileSystem, String path, String... more) {
153:   public CloudStoragePath toAbsolutePath() {
169:   public CloudStoragePath toRealPath(LinkOption... options) {
234:   public CloudStoragePath subpath(int beginIndex, int endIndex) {
361:   private CloudStoragePath newPath(@Nullable UnixPath newPath) {
371:   private UnixPath getUnixPath(String newPath) {
380:   private final class PathIterator extends UnmodifiableIterator<Path> {
174:   private UnixPath toRealPathInternal(boolean errorCheck) {
31: import java.nio.file.Path;
44:  * Google Cloud Storage {@link Path}.
59:     this.path = path;
64:         fileSystem, UnixPath.getPath(fileSystem.config().permitEmptyPathComponents(), path, more));
72:   /** Returns path converted to a {@link BlobId} so I/O can be performed. */
74:     checkArgument(!path.toString().isEmpty(), "Object names cannot be empty.");
75:     return BlobId.of(bucket(), toRealPath().path.toString());
79:     return path.seemsLikeADirectory();
82:   // True if this path may be a directory (and pseudo-directories are enabled)
84:   // 1) does the path end in / ?
85:   // 2) (optional, if storage is set) is there a file whose name starts with path+/ ?
90:     if (path.seemsLikeADirectory()) {
100:     // Using the provided path + "/" as a prefix, can we find one file? If so, the path
102:     String prefix = path.removeBeginningSeparator().toString();
124:       if (("/" + name).startsWith(this.path.toAbsolutePath() + "/")) {
140:     return newPath(path.getRoot());
145:     return path.isAbsolute();
149:    * Changes relative path to be absolute, using {@link CloudStorageConfiguration#workingDirectory()
154:     return newPath(path.toAbsolutePath(getWorkingDirectory()));
158:    * Returns this path rewritten to the Cloud Storage object name that'd be used to perform i/o.
160:    * <p>This method makes path {@link #toAbsolutePath() absolute} and removes the prefix slash from
161:    * the absolute path when {@link CloudStorageConfiguration#stripPrefixSlash() stripPrefixSlash} is
164:    * @throws IllegalArgumentException if path contains extra slashes or dot-dirs when {@link
166:    *     false}, or if the resulting path is empty.
175:     UnixPath objectName = path.toAbsolutePath(getWorkingDirectory());
189:    * Returns path without extra slashes or {@code .} and {@code ..} and preserves trailing slash.
193:     return newPath(path.normalize());
197:   public CloudStoragePath resolve(Path object) {
198:     return newPath(path.resolve(CloudStorageUtil.checkPath(object).path));
203:     return newPath(path.resolve(getUnixPath(other)));
207:   public CloudStoragePath resolveSibling(Path other) {
208:     return newPath(path.resolveSibling(CloudStorageUtil.checkPath(other).path));
213:     return newPath(path.resolveSibling(getUnixPath(other)));
217:   public CloudStoragePath relativize(Path object) {
218:     return newPath(path.relativize(CloudStorageUtil.checkPath(object).path));
224:     return newPath(path.getParent());
230:     return newPath(path.getFileName());
235:     return newPath(path.subpath(beginIndex, endIndex));
240:     return path.getNameCount();
245:     return newPath(path.getName(index));
249:   public boolean startsWith(Path other) {
257:     return path.startsWith(that.path);
262:     return path.startsWith(getUnixPath(other));
266:   public boolean endsWith(Path other) {
274:     return path.endsWith(that.path);
279:     return path.endsWith(getUnixPath(other));
310:   public Iterator<Path> iterator() {
311:     if (path.isEmpty()) {
312:       return Collections.<Path>singleton(this).iterator();
313:     } else if (path.isRoot()) {
321:   public int compareTo(Path other) {
347:     return path.toString();
354:           CloudStorageFileSystem.URI_SCHEME, bucket(), path.toAbsolutePath().toString(), null);
362:     if (newPath == path) { // Nonuse of equals is intentional.
381:     private final Iterator<String> delegate = path.split();
384:     public Path next() {
46:  * @see UnixPath
63:     return new CloudStoragePath(
139:   public CloudStoragePath getRoot() {
171:     return newPath(toRealPathInternal(true));
192:   public CloudStoragePath normalize() {
202:   public CloudStoragePath resolve(String other) {
212:   public CloudStoragePath resolveSibling(String other) {
223:   public CloudStoragePath getParent() {
229:   public CloudStoragePath getFileName() {
244:   public CloudStoragePath getName(int index) {
250:     if (!(checkNotNull(other) instanceof CloudStoragePath)) {
253:     CloudStoragePath that = (CloudStoragePath) other;
267:     if (!(checkNotNull(other) instanceof CloudStoragePath)) {
270:     CloudStoragePath that = (CloudStoragePath) other;
316:       return new PathIterator();
323:     CloudStoragePath that = (CloudStoragePath) other;
334:         || other instanceof CloudStoragePath
335:             && Objects.equals(bucket(), ((CloudStoragePath) other).bucket())
337:                 toRealPathInternal(false), ((CloudStoragePath) other).toRealPathInternal(false));
364:     } else if (newPath != null) {
365:       return new CloudStoragePath(fileSystem, newPath);
372:     return UnixPath.getPath(fileSystem.config().permitEmptyPathComponents(), newPath);
375:   private UnixPath getWorkingDirectory() {
376:     return getUnixPath(fileSystem.config().workingDirectory());
385:       return newPath(getUnixPath(delegate.next()));
165:    *     CloudStorageConfiguration#permitEmptyPathComponents() permitEmptyPathComponents} is {@code
176:     if (errorCheck && !fileSystem.config().permitEmptyPathComponents()) {
179:           "I/O not allowed on dot-dirs or extra slashes when !permitEmptyPathComponents: %s",
328:     return toRealPathInternal(false).compareTo(that.toRealPathInternal(false));
342:     return Objects.hash(bucket(), toRealPathInternal(false));
github.com/apache/sling-org-apache-sling-jcr-contentloader:src/main/java/org/apache/sling/jcr/contentloader/internal/PathEntry.java: [ master, ]
101:     private final String path;
69:     public static final String PATH_DIRECTIVE = "path";
33: public class PathEntry extends ImportOptions {
154:     public PathEntry(ManifestHeader.Entry entry, long bundleLastModified) {
248:     public String getPath() {
132:     public static Iterator<PathEntry> getContentPaths(final Bundle bundle) {
31:  * A path entry from the manifest for initial content.
66:      * The path directive specifying the target node where initial content will
100:     /** The path for the initial content. */
122:      * Target path where initial content will be loaded. If it´s null then
155:         this.path = entry.getValue();
201:         // path directive
202:         final String pathValue = entry.getDirectiveValue(PATH_DIRECTIVE);
249:         return this.path;
133:         final List<PathEntry> entries = new ArrayList<>();
144:                 entries.add(new PathEntry(entry, bundleLastModified ));
203:         if (pathValue != null) {
204:             this.target = pathValue;
237:         if (pathValue != null) {
github.com/apache/sling-org-apache-sling-commons-jcr-file:src/main/java/org/apache/sling/commons/jcr/file/internal/JcrPath.java: [ master, ]
41:     private final String path;
37: public class JcrPath implements Path {
47:     JcrPath(final JcrFileSystem fileSystem, final String path) {
54:     JcrPath(final JcrFileSystem fileSystem, final String first, final String... more) {
137:     public Path subpath(int beginIndex, int endIndex) {
229:     public Path toAbsolutePath() {
240:     public Path toRealPath(LinkOption... options) throws IOException {
26: import java.nio.file.Path;
49:         this.path = PathUtil.normalize(path);
50:         this.names = names(this.path);
51:         logger.info("new path: {}", path);
56:         this.path = PathUtil.normalize(first + JcrFileSystem.SEPARATOR + String.join(JcrFileSystem.SEPARATOR, more));
57:         this.names = names(this.path);
58:         logger.info("new path: {}", path);
61:     private List<String> names(final String path) {
63:         if (path != null) {
64:             final String[] strings = path.split("/");
76:         logger.info("getting file system for {}", path);
82:         logger.info("isAbsolute: {}", path);
83:         return path.startsWith("/");
87:     public Path getRoot() {
88:         logger.info("getting root for {}", path);
93:     public Path getFileName() {
94:         logger.info("getting file name for {}", path);
105:     public Path getParent() {
106:         logger.info("getting parent for {}", path);
107:         final String parent = PathUtil.getParent(path);
116:         logger.info("getting name count: {}", path);
121:     public Path getName(int index) {
122:         logger.info("getting name: {}", path);
138:         logger.info("subpath: {}", path);
144:     public boolean startsWith(Path other) {
145:         logger.info("startsWith: {}", path);
152:         logger.info("startsWith: {}", path);
158:     public boolean endsWith(Path other) {
159:         logger.info("endsWith: {}", path);
166:         logger.info("endsWith: {}", path);
171:     public Path normalize() {
172:         logger.info("normalizing path {}", path);
173:         return new JcrPath(fileSystem, PathUtil.normalize(path));
178:     public Path resolve(Path other) {
179:         logger.info("resolving given path {} against this path {}", other, this);
183:         if (this.path.endsWith("/")) {
184:             final String path = this.path.concat(other.toString());
185:             return new JcrPath(fileSystem, path);
187:             final String path = String.format("%s/%s", this.path, other.toString());
188:             return new JcrPath(fileSystem, path);
194:     public Path resolve(String other) {
195:         logger.info("resolving given path {} against this path {}", other, this);
196:         final Path path = new JcrPath(fileSystem, other); // TODO InvalidPathException
197:         return resolve(path);
202:     public Path resolveSibling(Path other) {
209:     public Path resolveSibling(String other) {
216:     public Path relativize(Path other) {
224:         logger.info("toUri: {}", path);
230:         logger.info("toAbsolutePath: {}", path);
234:             return new JcrPath(fileSystem, "/".concat(path));
241:         logger.info("toRealPath: {}", path);
247:         logger.info("to file: {}", path);
248:         return new JcrFile(fileSystem, path);
267:     public Iterator<Path> iterator() {
274:     public int compareTo(Path other) {
281:         return path;
45:     private final Logger logger = LoggerFactory.getLogger(JcrPath.class);
89:         return new JcrPath(fileSystem, "/");
100:             return new JcrPath(fileSystem, name);
111:         return new JcrPath(fileSystem, parent);
132:         return new JcrPath(fileSystem, names.get(index));
github.com/apache/sling-org-apache-sling-models-api:src/main/java/org/apache/sling/models/annotations/injectorspecific/ResourcePath.java: [ master, ]
43:     public String path() default "";
38: public @interface ResourcePath {
48:     public String[] paths() default {};
32:  * resource by path(s). The path may be either in the path/paths attribute or in a value map property with the given name.
37: @Source("resource-path")
41:      * Specifies the path of the resource. If not provided, the path is derived from the property name.
46:      * Specifies more than one path for the resource. If not provided, a single path is derived from the property name.
51:      * Specifies the name of the property containing the resource path. If empty or not set, then the name
github.com/apache/sling-org-apache-sling-testing-hamcrest:src/main/java/org/apache/sling/hamcrest/matchers/ResourcePathMatcher.java: [ master, ]
28:     private final String path;
26: public class ResourcePathMatcher extends TypeSafeMatcher<Resource> {
30:     public ResourcePathMatcher(String path) {
24:  * Matcher which matches whenever the path of the given resource is equal to the path given in the constructor.
31:         this.path = path;
36:         description.appendText("Resource with path ").appendValue(path);
41:         return path.equals(resource.getPath());
46:         mismatchDescription.appendText("was Resource with path ").appendValue(resource.getPath()).appendText(" (resource: ").appendValue(resource).appendText(")");
github.com/apache/httpcomponents-core:httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/PathEntity.java: [ master, ]
46:     private final Path path;
44: public class PathEntity extends AbstractHttpEntity {
48:     public PathEntity(final Path path, final ContentType contentType, final String contentEncoding) {
53:     public PathEntity(final Path path, final ContentType contentType) {
33: import java.nio.file.Path;
41:  * A self contained, repeatable entity that obtains its content from a path.
50:         this.path = Args.notNull(path, "Path");
55:         this.path = Args.notNull(path, "Path");
66:             return Files.size(this.path);
74:         return Files.newInputStream(path);
github.com/apache/flex-whiteboard:fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/infrastructure/message/ValidateJavaPathMessage.as: [ trunk, ]
26:         public function get path():String {
18:     public class ValidateJavaPathMessage {
22:         public function ValidateJavaPathMessage(path:String) {
20:         private var _path:String;
23:             _path = path;
27:             return _path;
github.com/GoogleCloudPlatform/datanucleus-appengine:testing/selenium-core/xpath/javascript-xpath-0.1.8.js: [ master, ]
645: UnionExpr.prototype.path = function(path) {
74: var PathExpr;
673: PathExpr = function(filter) {
2755:     win.XPathExpression = function(expr) {
2773:     win.XPathResult = function (value, type) {
614:     union.path(expr);
619:             throw Error('missing next union location path');
621:         union.path(PathExpr.parse(lexer));
646:     this.paths.push(path);
648:     if (path.needContextPosition) {
651:     if (path.needContextNode) {
686:     var op, expr, path, token;
698:         path = new PathExpr(FilterExpr.root()); // RootExpr
704:         path.step(op, expr);
710:             path = new PathExpr(FilterExpr.context());
711:             path.step('/', expr);
716:             path = new PathExpr(expr);
725:         path.step(op, Step.parse(lexer));
728:     return path;
806:     t += indent + 'path:' + '\n';
1: /*  JavaScript-XPath 0.1.8
4:  *  JavaScript-XPath is freely distributable under the terms of an MIT-style license.
5:  *  For details, see the JavaScript-XPath web site: http://coderepos.org/share/wiki/JavaScript-XPath
24: if (window.jsxpath) {
25:     config = window.jsxpath;
57:                         && document.implementation.hasFeature("XPath", null));
600:     this.paths = [];
609:     expr = PathExpr.parse(lexer);
635:     var paths = this.paths;
637:     for (var i = 0, l = paths.length; i < l; i ++) {
638:         var exrs = paths[i].evaluate(ctx);
639:         if (!exrs.isNodeSet) throw Error('PathExpr must be nodeset');
660:     for (var i = 0; i < this.paths.length; i ++) {
661:         t += this.paths[i].show(indent);
668:  * class: PathExpr
670: if (!window.PathExpr && window.defaultConfig)
671:     window.PathExpr = null;
683: PathExpr.ops = { '//': 1, '/': 1 };
685: PathExpr.parse = function(lexer) {
731: PathExpr.prototype = new BaseExpr();
733: PathExpr.prototype.evaluate = function(ctx) {
786: PathExpr.prototype.step = function(op, step) {
803: PathExpr.prototype.show = function(indent) {
1013:             // fix for "xpath href with spaces" (http://jira.openqa.org/browse/SEL-347)   
2273:         return node.__jsxpath_id__ || (node.__jsxpath_id__ = this.uuid++);
2769:     win.XPathExpression.prototype.evaluate = function(node, type) {
2770:         return new win.XPathResult(this.expr.evaluate(new Ctx(node)), type);
2807:     win.XPathResult.prototype.iterateNext = function() { return this.nodes[this.index++] };
2808:     win.XPathResult.prototype.snapshotItem = function(i) { return this.nodes[i] };
2810:     win.XPathResult.ANY_TYPE = 0;
2811:     win.XPathResult.NUMBER_TYPE = 1;
2812:     win.XPathResult.STRING_TYPE = 2;
2813:     win.XPathResult.BOOLEAN_TYPE = 3;
2814:     win.XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4;
2815:     win.XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5;
2816:     win.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6;
2817:     win.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7;
2818:     win.XPathResult.ANY_UNORDERED_NODE_TYPE = 8;
2819:     win.XPathResult.FIRST_ORDERED_NODE_TYPE = 9;
2823:         return new win.XPathExpression(expr, null);
github.com/apache/sling-org-apache-sling-junit-scriptable:src/main/java/org/apache/sling/junit/scriptable/TestAllPaths.java: [ master, ]
37:     private final String path;
35: public class TestAllPaths {
41:     public TestAllPaths(String path) {
33: /** The single test class that runs all our path-based tests */
42:         this.path = path;
49:         for(String path : ScriptableTestsProvider.getTestContext().testPaths) {
50:             data.add(new Object[] { path + TEST_URL_SUFFIX });
60:         final HttpRequest req = new HttpRequest(path);
64:         assertEquals("Expecting HTTP status 200 for path " + path, 200, resp.getStatus());
70:             fail("Unexpected content at path " + path
45:     /** Let JUnit run this all on our paths */
android.googlesource.com/platform/external/xmp_toolkit:XMPCore/src/com/adobe/xmp/impl/xpath/XMPPathParser.java: [ master, ]
527: 	public String path = null;
10: package com.adobe.xmp.impl.xpath;
84: 	public static XMPPath expandXPath(String schemaNS, String path) throws XMPException
524: class PathPosition
24: public final class XMPPathParser
29: 	private XMPPathParser()
172: 	private static void skipPathDelimiter(String path, PathPosition pos) throws XMPException
452: 	private static String verifyXPathRoot(String schemaNS, String rootProp)
77: 	 * @param path
86: 		if (schemaNS == null  ||  path == null)
93: 		pos.path = path;
100: 		while (pos.stepEnd < path.length())
104: 			skipPathDelimiter(path, pos);
110: 			if (path.charAt(pos.stepBegin) != '[')
139: 				verifyQualName(pos.path.substring(pos.nameStart, pos.nameEnd));
157: 					verifyQualName(pos.path.substring(pos.nameStart, pos.nameEnd));
168: 	 * @param path
174: 		if (path.charAt(pos.stepBegin) == '/')
181: 			if (pos.stepBegin >= path.length())
187: 		if (path.charAt(pos.stepBegin) == '*')
192: 			if (pos.stepBegin >= path.length() || path.charAt(pos.stepBegin) != '[')
202: 	 * @param pos the current position in the path
209: 		while (pos.stepEnd < pos.path.length() && "/[*".indexOf(pos.path.charAt(pos.stepEnd)) < 0)
221: 		XMPPathSegment segment = new XMPPathSegment(pos.path.substring(pos.stepBegin, pos.stepEnd),
230: 	 * @param pos the xmp path 
232: 	 * @throws XMPException thrown on xmp path errors
240: 		if ('0' <= pos.path.charAt(pos.stepEnd) && pos.path.charAt(pos.stepEnd) <= '9')
243: 			while (pos.stepEnd < pos.path.length() && '0' <= pos.path.charAt(pos.stepEnd)
244: 					&& pos.path.charAt(pos.stepEnd) <= '9')
255: 			while (pos.stepEnd < pos.path.length() && pos.path.charAt(pos.stepEnd) != ']'
256: 					&& pos.path.charAt(pos.stepEnd) != '=')
261: 			if (pos.stepEnd >= pos.path.length())
266: 			if (pos.path.charAt(pos.stepEnd) == ']')
268: 				if (!"[last()".equals(pos.path.substring(pos.stepBegin, pos.stepEnd)))
280: 				char quote = pos.path.charAt(pos.stepEnd);
288: 				while (pos.stepEnd < pos.path.length())
290: 					if (pos.path.charAt(pos.stepEnd) == quote)
293: 						if (pos.stepEnd + 1 >= pos.path.length()
294: 								|| pos.path.charAt(pos.stepEnd + 1) != quote)
303: 				if (pos.stepEnd >= pos.path.length())
316: 		if (pos.stepEnd >= pos.path.length() || pos.path.charAt(pos.stepEnd) != ']')
321: 		segment.setName(pos.path.substring(pos.stepBegin, pos.stepEnd));
328: 	 * Parses the root node of an XMP Path, checks if namespace and prefix fit together
332: 	 * @param expandedXPath  the path to contribute to
333: 	 * @throws XMPException If the path is not valid.
338: 		while (pos.stepEnd < pos.path.length() && "/[*".indexOf(pos.path.charAt(pos.stepEnd)) < 0)
348: 		String rootProp = verifyXPathRoot(schemaNS, pos.path.substring(pos.stepBegin, pos.stepEnd));
526: 	/** the complete path */
36: 	 * Split an XMPPath expression apart at the conceptual steps, adding the
38: 	 * put in the first (0th) slot in the expanded XMPPath. Check if the top
79: 	 * @return Returns the expandet XMPPath.
91: 		XMPPath expandedXPath = new XMPPath();
92: 		PathPosition pos = new PathPosition();
97: 		parseRootNode(schemaNS, pos, expandedXPath);
99: 		// Now continue to process the rest of the XMPPath string.
122: 			if (segment.getKind() == XMPPath.STRUCT_FIELD_STEP)
130: 								XMPError.BADXPATH);
136: 					segment.setKind(XMPPath.QUALIFIER_STEP);
141: 			else if (segment.getKind() == XMPPath.FIELD_SELECTOR_STEP)
149: 								XMPError.BADXPATH);
156: 					segment.setKind(XMPPath.QUAL_SELECTOR_STEP);
161: 			expandedXPath.add(segment);
163: 		return expandedXPath;
183: 				throw new XMPException("Empty XMPPath segment", XMPError.BADXPATH);
194: 				throw new XMPException("Missing '[' after '*'", XMPError.BADXPATH);
206: 	private static XMPPathSegment parseStructSegment(PathPosition pos) throws XMPException
217: 			throw new XMPException("Empty XMPPath segment", XMPError.BADXPATH);
222: 				XMPPath.STRUCT_FIELD_STEP);
235: 	private static XMPPathSegment parseIndexSegment(PathPosition pos) throws XMPException
249: 			segment = new XMPPathSegment(null, XMPPath.ARRAY_INDEX_STEP);
263: 				throw new XMPException("Missing ']' or '=' for array index", XMPError.BADXPATH);
271: 						"Invalid non-numeric array index", XMPError.BADXPATH);
273: 				segment = new XMPPathSegment(null, XMPPath.ARRAY_LAST_STEP);
284: 						"Invalid quote in array selector", XMPError.BADXPATH);
306: 							XMPError.BADXPATH);
311: 				segment = new XMPPathSegment(null, XMPPath.FIELD_SELECTOR_STEP);
318: 			throw new XMPException("Missing ']' for array index", XMPError.BADXPATH);
335: 	private static void parseRootNode(String schemaNS, PathPosition pos, XMPPath expandedXPath)
345: 			throw new XMPException("Empty initial XMPPath step", XMPError.BADXPATH);
352: 			// add schema xpath step
353: 			expandedXPath.add(new XMPPathSegment(schemaNS, XMPPath.SCHEMA_NODE));
354: 			XMPPathSegment rootStep = new XMPPathSegment(rootProp, XMPPath.STRUCT_FIELD_STEP);
355: 			expandedXPath.add(rootStep);
359: 			// add schema xpath step and base step of alias
360: 			expandedXPath.add(new XMPPathSegment(aliasInfo.getNamespace(), XMPPath.SCHEMA_NODE));
363: 					XMPPath.STRUCT_FIELD_STEP);
366: 			expandedXPath.add(rootStep);
371: 						XMPPath.QUAL_SELECTOR_STEP);
374: 				expandedXPath.add(qualSelectorStep);
379: 					XMPPath.ARRAY_INDEX_STEP);
382: 				expandedXPath.add(indexStep);
413: 						XMPError.BADXPATH);
417: 		throw new XMPException("Ill-formed qualified name", XMPError.BADXPATH);
433: 			throw new XMPException("Bad XML name", XMPError.BADXPATH);
439: 	 * Set up the first 2 components of the expanded XMPPath. Normalizes the various cases of using
448: 	 * @param rootProp the root xpath segment
466: 			throw new XMPException("Top level name must not be a qualifier", XMPError.BADXPATH);
471: 			throw new XMPException("Top level name must be simple", XMPError.BADXPATH);
481: 		// expanded XMPPath.
20:  * Parser for XMP XPaths.
109: 			XMPPathSegment segment;
237: 		XMPPathSegment segment;
361: 			XMPPathSegment rootStep = new XMPPathSegment(verifyXPathRoot(aliasInfo.getNamespace(),
370: 				XMPPathSegment qualSelectorStep = new XMPPathSegment("[?xml:lang='x-default']",
378: 				XMPPathSegment indexStep = new XMPPathSegment("[1]",
github.com/apache/airavata-custos:credential-store/credential-core/src/main/java/org/apache/airavata/custos/vault/annotations/VaultPath.java: [ master, ]
31:     public String path();
29: public @interface VaultPath {
github.com/apache/sling-org-apache-sling-auth-core:src/main/java/org/apache/sling/auth/core/impl/PathBasedHolder.java: [ master, ]
63:     final String path;
38: public abstract class PathBasedHolder implements Comparable<PathBasedHolder> {
44:     protected final String fullPath;
86:     protected PathBasedHolder(final String url,
30:  * <li>Provide location of control through its path fields</li>
41:      * The full registration path of this instance. This is the actual URL with
59:      * The path part of the URL of the {@link #fullPath}. If that URL contains
80:      * their path is equal.
89:         String path = url;
93:         // check for protocol prefix in the full path
94:         if (path.startsWith("http://") || path.startsWith("https://")) {
95:             int idxProtocolEnd = path.indexOf("://");
96:             protocol = path.substring(0, idxProtocolEnd);
97:             path = path.substring(idxProtocolEnd + 1);
100:         // check for host prefix in the full path
101:         if (path.startsWith("//")) {
102:             int idxHostEnd = path.indexOf("/", 2);
103:             idxHostEnd = idxHostEnd == -1 ? path.length() : idxHostEnd;
105:             if (path.length() > 2) {
106:                 host = path.substring(2, idxHostEnd);
107:                 if (idxHostEnd < path.length()) {
108:                     path = path.substring(idxHostEnd);
110:                     path = "/";
113:                 path = "/";
119:         this.path = path;
151:      * instance. Comparison takes into account the {@link #path} first. If they
152:      * are not equal the result is returned: If the <code>other</code> path is
153:      * lexicographically sorted behind this {@link #path} a value larger than
170:         // compare the path first, and return if not equal
171:         final int pathResult = other.path.compareTo(path);
195:      * Returns the hash code of the full path.
204:      * it is an instance of the same class with the same full path and the same
26:  * The <code>PathBasedHolder</code> provides the basic abstraction for managing
32:  * ordering according to the {@link #fullPath} and the
47:      * The Scheme part of the URL of the {@link #fullPath}. If no scheme is
53:      * The host part of the URL of the {@link #fullPath}. If no host is
61:      * {@link #fullPath}.
118:         this.fullPath = url;
150:      * Compares this instance to the <code>other</code> PathBasedHolder
156:      * If the paths are the same, a positive number is returned if the
168:     public int compareTo(PathBasedHolder other) {
172:         if (pathResult != 0) {
173:             return pathResult;
199:         return fullPath.hashCode();
216:             PathBasedHolder other = (PathBasedHolder) obj;
217:             return fullPath.equals(other.fullPath)
android.googlesource.com/platform/external/nist-sip:java/gov/nist/javax/sip/header/ims/Path.java: [ master, ]
43: public class Path
51:     public Path(AddressImpl address) {
59:     public Path()
37: import gov.nist.javax.sip.header.ims.PathHeader;
45:     implements PathHeader, SIPHeaderNamesIms , ExtensionHeader{
android.googlesource.com/platform/external/mp4parser:isoparser/src/main/java/com/googlecode/mp4parser/util/Path.java: [ master, ]
29: public class Path {
31:     private Path() {
36:     public static String createPath(Box box) {
40:     private static String createPath(Box box, String path) {
52:     public static Box getPath(Box box, String path) {
58:     public static List<Box> getPaths(Box box, String path) {
42:             return path;
46:             path = String.format("/%s[%d]", box.getType(), index) + path;
48:             return createPath(box.getParent(), path);
53:         List<Box> all = getPaths(box, path);
59:         if (path.startsWith("/")) {
65:             return getPaths(isoFile, path.substring(1));
66:         } else if (path.isEmpty()) {
71:             if (path.contains("/")) {
72:                 later = path.substring(path.indexOf('/') + 1);
73:                 now = path.substring(0, path.indexOf('/'));
75:                 now = path;
104:                 throw new RuntimeException(now + " is invalid path.");
111:     public static boolean isContained(Box box, String path) {
112:         assert path.startsWith("/") : "Absolute path required";
113:         return getPaths(box, path).contains(box);
37:         return createPath(box, "");
83:                     return getPaths(box.getParent(), later);
96:                                 children.addAll(getPaths(box1, later));
github.com/apache/commons-graph:src/main/java/org/apache/commons/graph/Path.java: [ master, ]
29: public interface Path<V, E>
23:  * A {@code Path} in a {@link Graph} is a sequence of vertex such that from each of its vertices there is an
34:      * Returns the source of the path.
36:      * @return the source of the path.
41:      * Returns the target of the path.
43:      * @return the target of the path.
github.com/apache/sling-org-apache-sling-models-api:src/main/java/org/apache/sling/models/annotations/Path.java: [ master, ]
33: public @interface Path {
36:     public String[] paths() default {};
27:  * Provide path(s) on an &#64;Inject. Not necessarily tied to the Resource Path injector (thus no
github.com/apache/sling-org-apache-sling-commons-testing:src/main/java/org/apache/sling/commons/testing/sling/MockRequestPathInfo.java: [ master, ]
36: 	private final String path;
53:     public String getResourcePath() {
24: class MockRequestPathInfo implements RequestPathInfo {
38: 	public MockRequestPathInfo(String selectors, String extension, String suffix) {
42: 	public MockRequestPathInfo(String selectors, String extension, String suffix, String path) {
46: 		this.path = path;
54:         return path;
21: import org.apache.sling.api.request.RequestPathInfo;
github.com/google/gson:gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java: [ master, ]
47:   @Test public void path() throws IOException {
86:   @Test public void objectPath() throws IOException {
126:   @Test public void arrayPath() throws IOException {
35: public class JsonReaderPathTest {
49:     assertEquals("$", reader.getPath());
51:     assertEquals("$.", reader.getPath());
53:     assertEquals("$.a", reader.getPath());
55:     assertEquals("$.a[0]", reader.getPath());
57:     assertEquals("$.a[1]", reader.getPath());
59:     assertEquals("$.a[2]", reader.getPath());
61:     assertEquals("$.a[3]", reader.getPath());
63:     assertEquals("$.a[4]", reader.getPath());
65:     assertEquals("$.a[5]", reader.getPath());
67:     assertEquals("$.a[5].", reader.getPath());
69:     assertEquals("$.a[5].c", reader.getPath());
71:     assertEquals("$.a[5].c", reader.getPath());
73:     assertEquals("$.a[6]", reader.getPath());
75:     assertEquals("$.a[6][0]", reader.getPath());
77:     assertEquals("$.a[6][1]", reader.getPath());
79:     assertEquals("$.a[7]", reader.getPath());
81:     assertEquals("$.a", reader.getPath());
83:     assertEquals("$", reader.getPath());
88:     assertEquals("$", reader.getPath());
91:     assertEquals("$", reader.getPath());
93:     assertEquals("$.", reader.getPath());
96:     assertEquals("$.", reader.getPath());
98:     assertEquals("$.a", reader.getPath());
101:     assertEquals("$.a", reader.getPath());
103:     assertEquals("$.a", reader.getPath());
106:     assertEquals("$.a", reader.getPath());
108:     assertEquals("$.b", reader.getPath());
111:     assertEquals("$.b", reader.getPath());
113:     assertEquals("$.b", reader.getPath());
116:     assertEquals("$.b", reader.getPath());
118:     assertEquals("$", reader.getPath());
121:     assertEquals("$", reader.getPath());
123:     assertEquals("$", reader.getPath());
128:     assertEquals("$", reader.getPath());
131:     assertEquals("$", reader.getPath());
133:     assertEquals("$[0]", reader.getPath());
136:     assertEquals("$[0]", reader.getPath());
138:     assertEquals("$[1]", reader.getPath());
141:     assertEquals("$[1]", reader.getPath());
143:     assertEquals("$[2]", reader.getPath());
146:     assertEquals("$[2]", reader.getPath());
148:     assertEquals("$", reader.getPath());
151:     assertEquals("$", reader.getPath());
153:     assertEquals("$", reader.getPath());
163:     assertEquals("$", reader.getPath());
166:     assertEquals("$", reader.getPath());
174:     assertEquals("$[2]", reader.getPath());
181:     assertEquals("$.null", reader.getPath());
187:     assertEquals("$.", reader.getPath());
190:     assertEquals("$.null", reader.getPath());
192:     assertEquals("$.b", reader.getPath());
199:     assertEquals("$[1]", reader.getPath());
205:     assertEquals("$[0]", reader.getPath());
207:     assertEquals("$[0].", reader.getPath());
209:     assertEquals("$[1]", reader.getPath());
211:     assertEquals("$[1].", reader.getPath());
213:     assertEquals("$[2]", reader.getPath());
215:     assertEquals("$[2].", reader.getPath());
217:     assertEquals("$[3]", reader.getPath());
219:     assertEquals("$", reader.getPath());
225:     assertEquals("$[0]", reader.getPath());
227:     assertEquals("$[0][0]", reader.getPath());
229:     assertEquals("$[1]", reader.getPath());
231:     assertEquals("$[1][0]", reader.getPath());
233:     assertEquals("$[2]", reader.getPath());
235:     assertEquals("$[2][0]", reader.getPath());
237:     assertEquals("$[3]", reader.getPath());
239:     assertEquals("$", reader.getPath());
github.com/apache/sling-org-apache-sling-scripting-sightly:src/test/java/org/apache/sling/scripting/sightly/impl/engine/extension/ModifiableRequestPathInfoTest.java: [ master, ]
30:     private static final String PATH = "test";
38:     private static final URIManipulationFilterExtension.ModifiableRequestPathInfo simplePath =
41:             pathWithExtension = new URIManipulationFilterExtension.ModifiableRequestPathInfo(PATH + "." + EXTENSION);
43:             pathWithSelectors =
46:             pathWithSelectorsSuffix =
49:             pathWithMultipleDotsSuffix = new URIManipulationFilterExtension.ModifiableRequestPathInfo(
54:     public void testGetResourcePath() throws Exception {
27: public class ModifiableRequestPathInfoTest {
36:     private static final URIManipulationFilterExtension.ModifiableRequestPathInfo emptyPathInfo =
39:             new URIManipulationFilterExtension.ModifiableRequestPathInfo(PATH);
44:             new URIManipulationFilterExtension.ModifiableRequestPathInfo(PATH + "." + SELECTOR_STRING + "." + EXTENSION);
47:             new URIManipulationFilterExtension.ModifiableRequestPathInfo(PATH + "." + SELECTOR_STRING + "." + EXTENSION + SUFFIX);
56:         assertEquals(PATH, simplePath.getResourcePath());
57:         assertEquals(PATH, pathWithExtension.getResourcePath());
58:         assertEquals(PATH, pathWithSelectors.getResourcePath());
59:         assertEquals(PATH, pathWithSelectorsSuffix.getResourcePath());
66:         assertEquals(PATH, simplePath.toString());
67:         assertEquals(PATH + "." + EXTENSION, pathWithExtension.toString());
68:         assertEquals(PATH + "." + SELECTOR_STRING + "." + EXTENSION, pathWithSelectors.toString());
69:         assertEquals(PATH + "." + SELECTOR_STRING + "." + EXTENSION + SUFFIX, pathWithSelectorsSuffix.toString());
55:         assertEquals(EMPTY, emptyPathInfo.getResourcePath());
60:         assertEquals("test/child", pathWithMultipleDotsSuffix.getResourcePath());
70:         assertEquals("test/child.name/resource." + SELECTOR_STRING + "." + EXTENSION + SUFFIX, pathWithMultipleDotsSuffix.toString());
76:         assertEquals(0, simplePath.getSelectors().length);
77:         assertEquals(0, pathWithExtension.getSelectors().length);
78:         assertArrayEquals(SELECTOR_STRING_SET, pathWithSelectors.getSelectors());
79:         assertArrayEquals(SELECTOR_STRING_SET, pathWithSelectorsSuffix.getSelectors());
80:         assertEquals(0, pathWithMultipleDotsSuffix.getSelectors().length);
86:         assertNull(simplePath.getExtension());
87:         assertEquals(EXTENSION, pathWithExtension.getExtension());
88:         assertEquals(EXTENSION, pathWithSelectors.getExtension());
89:         assertEquals(EXTENSION, pathWithSelectorsSuffix.getExtension());
90:         assertEquals("name", pathWithMultipleDotsSuffix.getExtension());
96:         assertNull(simplePath.getSuffix());
97:         assertNull(pathWithExtension.getSuffix());
98:         assertNull(pathWithSelectors.getSuffix());
99:         assertEquals(SUFFIX, pathWithSelectorsSuffix.getSuffix());
100:         assertEquals("/resource." + SELECTOR_STRING + "." + EXTENSION + SUFFIX, pathWithMultipleDotsSuffix.getSuffix());
37:             new URIManipulationFilterExtension.ModifiableRequestPathInfo(EMPTY);
40:     private static final URIManipulationFilterExtension.ModifiableRequestPathInfo
42:     private static final URIManipulationFilterExtension.ModifiableRequestPathInfo
45:     private static final URIManipulationFilterExtension.ModifiableRequestPathInfo
48:     private static final URIManipulationFilterExtension.ModifiableRequestPathInfo
65:         assertEquals(EMPTY, emptyPathInfo.toString());
75:         assertEquals(0, emptyPathInfo.getSelectors().length);
85:         assertNull(emptyPathInfo.getExtension());
95:         assertNull(emptyPathInfo.getSuffix());
github.com/apache/dubbo:dubbo-common/src/main/java/org/apache/dubbo/common/URL.java: [ master, ]
108:     private final String path;
550:     public String getPath() {
554:     public URL setPath(String path) {
558:     public String getAbsolutePath() {
1450:     public String getPathKey() {
53: import static org.apache.dubbo.common.constants.CommonConstants.PATH_KEY;
73:  * for this case, url protocol = null, url host = 192.168.1.3, port = 20880, url path = null
75:  * for this case, url protocol = file, url host = null, url path = home/user1/router.js
77:  * for this case, url protocol = file, url host = home, url path = user1/router.js
79:  * for this case, url protocol = file, url host = null, url path = D:/1/router.js
83:  * for this case, url protocol = null, url host = null, url path = home/user1/router.js
85:  * for this case, url protocol = null, url host = home, url path = user1/router.js
143:         this.path = null;
152: ...(16 bytes skipped)...tring protocol, String host, int port, String[] pairs) { // varargs ... conflict with the following path argument, use array instead.
160:     public URL(String protocol, String host, int port, String path) {
161:         this(protocol, null, null, host, port, path, (Map<String, String>) null);
164:     public URL(String protocol, String host, int port, String path, String... pairs) {
165:         this(protocol, null, null, host, port, path, CollectionUtils.toStringMap(pairs));
168:     public URL(String protocol, String host, int port, String path, Map<String, String> parameters) {
169:         this(protocol, null, null, host, port, path, parameters);
172:     public URL(String protocol, String username, String password, String host, int port, String path) {
173:         this(protocol, username, password, host, port, path, (Map<String, String>) null);
176:     public URL(String protocol, String username, String password, String host, int port, String path, String... pairs) {
177:         this(protocol, username, password, host, port, path, CollectionUtils.toStringMap(pairs));
185:                String path,
187:         this(protocol, username, password, host, port, path, parameters, toMethodParameters(parameters));
195:                String path,
210:         while (path != null && path.startsWith("/")) {
211:             path = path.substring(1);
213:         this.path = path;
245:         String path = null;
278:             // case: file:/path/to/file.txt
291:             path = url.substring(i + 1);
320:         return new URL(protocol, username, password, host, port, path, parameters);
439:         return new URL(protocol, username, password, host, port, path, getParameters());
447:         return new URL(protocol, username, password, host, port, path, getParameters());
455:         return new URL(protocol, username, password, host, port, path, getParameters());
472:         return new URL(protocol, username, password, host, port, path, getParameters());
495:         return new URL(protocol, username, password, host, port, path, getParameters());
519:         return new URL(protocol, username, password, host, port, path, getParameters());
551:         return path;
555:         return new URL(protocol, username, password, host, port, path, getParameters());
559:         if (path != null && !path.startsWith("/")) {
560:             return "/" + path;
562:         return path;
1079:         return new URL(protocol, username, password, host, port, path, map);
1093:         return new URL(protocol, username, password, host, port, path, map);
1108:         return new URL(protocol, username, password, host, port, path, map, methodMap);
1126:         return new URL(protocol, username, password, host, port, path, map, methodMap);
1162:         return new URL(protocol, username, password, host, port, path, map);
1171:         return new URL(protocol, username, password, host, port, path, map);
1221:         return new URL(protocol, username, password, host, port, path, map);
1225:         return new URL(protocol, username, password, host, port, path, new HashMap<>());
1244:         if (PATH_KEY.equals(key)) {
1245:             return path;
1267:         if (path != null) {
1268:             map.put(PATH_KEY, path);
1374:         String path;
1376:             path = getServiceKey();
1378:             path = getPath();
1380:         if (StringUtils.isNotEmpty(path)) {
1382:             buf.append(path);
1446:      * The format of return value is '{group}/{path/interfaceName}:{version}'
1451:         String inf = StringUtils.isNotEmpty(path) ? path : getServiceInterface();
1458:     public static String buildKey(String path, String group, String version) {
1459:         return BaseServiceMetadata.buildServiceKey(path, group, version);
1476:         return getParameter(INTERFACE_KEY, path);
1586:         result = prime * result + ((path == null) ? 0 : path.hashCode());
1618:         if (!StringUtils.isEquals(path, other.path)) {
396: ...(36 bytes skipped)...w URL(url.getProtocol(), url.getUsername(), url.getPassword(), url.getHost(), url.getPort(), url.getPath())
397: ...(20 bytes skipped)...w URL(url.getProtocol(), url.getUsername(), url.getPassword(), url.getHost(), url.getPort(), url.getPath(), newMap);
github.com/apache/hadoop:hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java: [ trunk, ]
421:     String path;
861:     String path;
952:     private String path;
1065:     String path;
1159:     String path;
1508:     String path;
1606:     String path;
2404:     String path;
2511:     String path;
2971:     String path;
4824:     String path;
292:     String getPath();
468:     <T extends AddCloseOp> T setPath(String path) {
474:     public String getPath() {
874:     AppendOp setPath(String path) {
971:     AddBlockOp setPath(String path) {
976:     public String getPath() {
1082:     UpdateBlocksOp setPath(String path) {
1088:     public String getPath() {
1176:     SetReplicationOp setPath(String path) {
1526:     DeleteOp setPath(String path) {
1636:     MkdirOp setPath(String path) {
2424:     TimesOp setPath(String path) {
2541:     SymlinkOp setPath(String path) {
2858:     TruncateOp setPath(String src) {
2994:     ReassignLeaseOp setPath(String path) {
4841:     SetStoragePolicyOp setPath(String path) {
447:       path = null;
469:       this.path = path;
475:       return path;
561:       FSImageSerialization.writeString(path, out);
609:       this.path = FSImageSerialization.readString(in);
703:           .append(", path=")
704:           .append(path)
746:       XMLUtils.addSaxString(contentHandler, "PATH", path);
777:       this.path = st.getValue("PATH");
875:       this.path = path;
898:           .append("[path=").append(path)
907:       this.path = null;
915:       this.path = FSImageSerialization.readString(in);
924:       FSImageSerialization.writeString(path, out);
933:       XMLUtils.addSaxString(contentHandler, "PATH", path);
943:       this.path = st.getValue("PATH");
966:       path = null;
972:       this.path = path;
977:       return path;
1000:       FSImageSerialization.writeString(path, out);
1014:       path = FSImageSerialization.readString(in);
1026:       sb.append("AddBlockOp [path=")
1027:           .append(path)
1039:       XMLUtils.addSaxString(contentHandler, "PATH", path);
1049:       this.path = st.getValue("PATH");
1078:       path = null;
1083:       this.path = path;
1089:       return path;
1105:       FSImageSerialization.writeString(path, out);
1113:       path = FSImageSerialization.readString(in);
1127:       sb.append("UpdateBlocksOp [path=")
1128:         .append(path)
1138:       XMLUtils.addSaxString(contentHandler, "PATH", path);
1146:       this.path = st.getValue("PATH");
1172:       path = null;
1177:       this.path = path;
1189:       FSImageSerialization.writeString(path, out);
1196:       this.path = FSImageSerialization.readString(in);
1208:       builder.append("SetReplicationOp [path=")
1209:           .append(path)
1222:       XMLUtils.addSaxString(contentHandler, "PATH", path);
1228:       this.path = st.getValue("PATH");
1522:       path = null;
1527:       this.path = path;
1539:       FSImageSerialization.writeString(path, out);
1554:       this.path = FSImageSerialization.readString(in);
1570:           .append(", path=")
1571:           .append(path)
1587:       XMLUtils.addSaxString(contentHandler, "PATH", path);
1595:       this.path = st.getValue("PATH");
1624:       path = null;
1637:       this.path = path;
1665:       FSImageSerialization.writeString(path, out);
1694:       this.path = FSImageSerialization.readString(in);
1728:           .append(", path=")
1729:           .append(path)
1752:       XMLUtils.addSaxString(contentHandler, "PATH", path);
1767:       this.path = st.getValue("PATH");
2419:       path = null;
2425:       this.path = path;
2442:       FSImageSerialization.writeString(path, out);
2457:       this.path = FSImageSerialization.readString(in);
2474:           .append(", path=")
2475:           .append(path)
2492:       XMLUtils.addSaxString(contentHandler, "PATH", path);
2501:       this.path = st.getValue("PATH");
2529:       path = null;
2542:       this.path = path;
2569:       FSImageSerialization.writeString(path, out);
2595:       this.path = FSImageSerialization.readString(in);
2619:           .append(", path=")
2620:           .append(path)
2644:       XMLUtils.addSaxString(contentHandler, "PATH", path);
2658:       this.path = st.getValue("PATH");
2985:       path = null;
2995:       this.path = path;
3008:       FSImageSerialization.writeString(path, out);
3016:       this.path = FSImageSerialization.readString(in);
3025:           .append(", path=")
3026:           .append(path)
3040:       XMLUtils.addSaxString(contentHandler, "PATH", path);
3046:       this.path = st.getValue("PATH");
3464:     /* set the directory path where the snapshot is taken. */
3556:     /* set the directory path where the snapshot is taken. */
3902:           .append("path=" + directive.getPath().toUri().getPath() + ",")
3969:         builder.append(",").append("path=").append(directive.getPath());
4837:       path = null;
4842:       this.path = path;
4853:       FSImageSerialization.writeString(path, out);
4860:       this.path = FSImageSerialization.readString(in);
4867:       builder.append("SetStoragePolicyOp [path=")
4868:           .append(path)
4881:       XMLUtils.addSaxString(contentHandler, "PATH", path);
4888:       this.path = st.getValue("PATH");
3866:       assert(directive.getPath() != null);
3968:       if (directive.getPath() != null) {
github.com/apache/hadoop:hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java: [ trunk, ]
5921:     final String path;
7824:   EncryptionZone getEZForPath(final String srcArg)
4099:   public byte[] getSrcPathsHash(String[] srcs) {
196: import org.apache.hadoop.fs.Path;
412:       Path symlink = stat.isSymlink()
413:           ? new Path(DFSUtilClient.bytes2String(stat.getSymlinkInBytes()))
415:       Path path = new Path(src);
420:           stat.getGroup(), symlink, path);
448:    * src=&lt;src path&gt;
449:    * dst=&lt;dst path (optional)&gt;
900:               CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
1920:    * @param path path to filter the open files.
1924:       EnumSet<OpenFilesType> openFilesTypes, String path) throws IOException {
1925:     INode.checkAbsolutePath(path);
1930:     String normalizedPath = new Path(path).toString(); // normalize path.
1958:       String path) {
1978:         if (org.apache.commons.lang3.StringUtils.isEmpty(path)
1979:             || DFSUtil.isParentEntry(fullPathName, path)) {
2186:    * This does not support ".inodes" relative path
2395:    * @param src file/directory path
2428:    * @param src file/directory path
2478:    * @param src file/directory path
2509:    *          file/directory path
2695:         // if the path has an encryption zone, the lock was released while
2696:         // generating the EDEK.  re-resolve the path to ensure the namesystem
2742:    * @param src the path of the file to start lease recovery
3327:    * Remove leases and inodes related to a given path
3359:    * @param src The string representation of the path to the file
3459:    * @param src The string representation of the path to the file
3495:    * @param src The string representation of the path to the file
3533:    * Note: This does not support ".inodes" relative path.
3566:    * @param src The string representation of the path
3572:    * @throws IOException if path does not exist
3834:       if (fullName != null && fullName.startsWith(Path.SEPARATOR)
3836:         // If file exists in normal path then no need to look in snapshot
3840:       // the snapshot path and current path may contain symlinks, ancestor
3842:       LOG.error("Error while resolving the path : " + fullName, e);
3849:      * 2. if fullName is not an absolute path, bc cannot be existent in the 
3912:       // file path is already removed from namespace by the delete operation,
4164:             throw new FileNotFoundException("Path " + src + " does not exist");
4390:    * @param path
4393:   private void closeFile(String path, INodeFile file) {
4396:     getEditLog().logCloseFile(path, file);
4398:         " to the file system", path, file.getBlocks().length);
5658:     // look at the path hierarchy to see if one parent is deleted by recursive
5925:       path = p;
5931:       return block.getBlockName() + "\t" + path;
5935:    * @param path Restrict corrupt files to this portion of namespace.
5941:   Collection<CorruptFileBlockInfo> listCorruptFileBlocks(String path,
5987:           if (isParentEntry(src, path)) {
6172:    * @param sdPath String storage directory path
6740:    * Get the list of corrupt blocks and corresponding full file path
6742:    * @param path Restrict corrupt files to this portion of namespace.
6750:   List<String> listCorruptFileBlocksWithSnapshot(String path,
6753:         listCorruptFileBlocks(path, cookieTab);
6772:       if (getFileInfo(c.path, true, false, false) != null) {
6776:           .getSnapshotFiles(getFSDirectory(), lsf, c.path);
6860:   void allowSnapshot(String path) throws IOException {
6867:       checkNameNodeSafeMode("Cannot allow snapshot for " + path);
6868:       FSDirSnapshotOp.allowSnapshot(dir, snapshotManager, path);
6870:       writeUnlock(operationName, getLockReportInfoSupplier(path));
6873:     logAuditEvent(true, operationName, path, null, null);
6877:   void disallowSnapshot(String path) throws IOException {
6884:       checkNameNodeSafeMode("Cannot disallow snapshot for " + path);
6885:       FSDirSnapshotOp.disallowSnapshot(dir, snapshotManager, path);
6887:       writeUnlock(operationName, getLockReportInfoSupplier(path));
6890:     logAuditEvent(true, operationName, path, null, null);
6895:    * @param snapshotRoot The directory path where the snapshot is taken
6927:    * @param path The directory path where the snapshot was taken
6934:       String path, String snapshotOldName, String snapshotNewName,
6938:     String oldSnapshotRoot = Snapshot.getSnapshotPath(path, snapshotOldName);
6939:     String newSnapshotRoot = Snapshot.getSnapshotPath(path, snapshotNewName);
6946:         checkNameNodeSafeMode("Cannot rename snapshot for " + path);
6947:         FSDirSnapshotOp.renameSnapshot(dir, pc, snapshotManager, path,
6998:    * @param path The full path of the snapshottable directory.
7009:   SnapshotDiffReport getSnapshotDiffReport(String path,
7016:         path : Snapshot.getSnapshotPath(path, fromSnapshot);
7018:         path : Snapshot.getSnapshotPath(path, toSnapshot);
7027:             path, fromSnapshot, toSnapshot);
7062:    * @param path The full path of the snapshottable directory.
7068:    *          path relative to the snapshottable root directory from where the
7082:   SnapshotDiffReportListing getSnapshotDiffReportListing(String path,
7089:         (fromSnapshot == null || fromSnapshot.isEmpty()) ? path :
7090:             Snapshot.getSnapshotPath(path, fromSnapshot);
7092:         (toSnapshot == null || toSnapshot.isEmpty()) ? path :
7093:             Snapshot.getSnapshotPath(path, toSnapshot);
7101:             .getSnapshotDiffReportListing(dir, pc, snapshotManager, path,
7778:    * @param src     the path of a directory which will be the root of the
7783:    * @throws UnresolvedLinkException if the path can't be resolved.
7817:    * Get the encryption zone for the specified path.
7819:    * @param srcArg the path of a file or directory to get the EZ for.
7820:    * @return the EZ of the of the path or null if none.
7822:    * @throws UnresolvedLinkException if the path can't be resolved.
7967:    * Set an erasure coding policy on the given path.
7968:    * @param srcArg  The path of the target directory.
7972:    * @throws UnresolvedLinkException if the path can't be resolved.
8140:    * Unset an erasure coding policy from the given path.
8141:    * @param srcArg  The path of the target directory.
8143:    * @throws UnresolvedLinkException if the path can't be resolved.
8212:    * Get the erasure coding policy information for specified path.
8411:           throw new FileNotFoundException("Path not found");
8438:       Path symlink = stat.isSymlink()
8439:           ? new Path(DFSUtilClient.bytes2String(stat.getSymlinkInBytes()))
8441:       Path path = new Path(src);
8446:         stat.getGroup(), symlink, path);
565:   // Maximum number of paths that can be listed per batched call.
1888:                 new OutputStreamWriter(Files.newOutputStream(file.toPath()),
1937:               normalizedPath);
1940:             batchedListEntries = getFilesBlockingDecom(prevId, normalizedPath);
2141:               final INodesInPath iip = dir.resolvePath(pc, src, DirOp.READ);
2651:     INodesInPath iip = null;
2701:               dir, pc, iip.getPath(), flag, createParent);
2759:       final INodesInPath iip = dir.resolvePath(pc, src, DirOp.WRITE);
2760:       src = iip.getPath();
2797:   boolean recoverLeaseInternal(RecoverLeaseOp op, INodesInPath iip,
3009:       final INodesInPath iip = dir.resolvePath(pc, src, fileId);
3010:       src = iip.getPath();
3072:   INodeFile checkLease(INodesInPath iip, String holder, long fileId)
3074:     String src = iip.getPath();
3584:       INodesInPath iip = dir.resolvePath(pc, src, fileId);
3585:       src = iip.getPath();
3612:   boolean internalReleaseLease(Lease lease, String src, INodesInPath iip,
3770:       final INodeFile fileINode, final INodesInPath iip,
3907:       // first removes the file paths from namespace, and delays the removal
4038:     final INodesInPath iip = INodesInPath.fromINode(pendingFile);
4114:       String msg = String.format("Too many source paths (%d > %d)",
4126:       // Validate that the passed paths match the checksum from key
4525:                   INodesInPath.fromINode((INodeFile) bc), false);
4987:     return leaseManager.countPath();
6174:   void saveSecretManagerStateCompat(DataOutputStream out, String sdPath)
6176:     dtSecretManager.saveSecretManagerStateCompat(out, sdPath);
6902:     String snapshotPath = null;
6910:         snapshotPath = FSDirSnapshotOp.createSnapshot(dir, pc,
6921:         snapshotPath, null);
6922:     return snapshotPath;
7067:    * @param startPath
7075:    *           from the startPath provided.
7083:       String fromSnapshot, String toSnapshot, byte[] startPath, int index)
7102:                 fromSnapshot, toSnapshot, startPath, index,
7128:     String rootPath = null;
7138:         rootPath = Snapshot.getSnapshotPath(snapshotRoot, snapshotName);
7142:         writeUnlock(operationName, getLockReportInfoSupplier(rootPath));
7145:       logAuditEvent(false, operationName, rootPath, null, null);
7155:     logAuditEvent(true, operationName, rootPath, null, null);
7826:     final String operationName = "getEZForPath";
7836:         Entry<EncryptionZone, FileStatus> ezForPath = FSDirEncryptionZoneOp
7837:             .getEZForPath(dir, srcArg, pc);
7838:         resultingStat = ezForPath.getValue();
7839:         encryptionZone = ezForPath.getKey();
7937:         final INodesInPath iip = dir.resolvePath(pc, zone, DirOp.WRITE);
8407:         final INodesInPath iip = dir.resolvePath(pc, src, DirOp.READ);
8408:         src = iip.getPath();
194: import org.apache.hadoop.fs.InvalidPathException;
1977:         String fullPathName = inodeFile.getFullPathName();
1981:               inodeFile.getFullPathName(),
2140:               src = inode.getFullPathName();
2472:     blockManager.getSPSManager().verifyOutstandingPathQLimit();
2641:       throw new InvalidPathException(src);
2664:       iip = FSDirWriteFileOp.resolvePathForStartFile(
2700:           iip = FSDirWriteFileOp.resolvePathForStartFile(
2766:         dir.checkPathAccess(pc, iip, FsAction.WRITE);
3923:       src = iFile.getFullPathName();
4130:               getSrcPathsHash(srcs)));
4131:       srcsIndex = startAfterProto.getPathIndex();
4221:             .setChecksum(ByteString.copyFrom(getSrcPathsHash(srcs)))
4222:             .setPathIndex(srcsIndex)
5832:     final String src = pendingFile.getFullPathName();
5986:           String src = inode.getFullPathName();
8414:           dir.checkPathAccess(pc, iip, mode);
github.com/apache/hadoop:hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/runc/RuncContainerExecutorConfig.java: [ trunk, ]
171:     final private String path;
267:       final private String path;
592:         final private String path;
755:         final private String path;
808:         final private String path;
47:   final private String containerScriptPath;
48:   final private String containerCredentialsPath;
50:   final private String keystorePath;
51:   final private String truststorePath;
82:   public String getContainerScriptPath() {
86:   public String getContainerCredentialsPath() {
93:   public String getKeystorePath() {
96:   public String getTruststorePath() {
177:     public String getPath() {
259:       public String getPath() {
597:         public String getPath() {
659:       final private String cgroupsPath;
686:       public String getCgroupsPath() {
819:         public String getPath() {
666:       final private List<String> maskedPaths;
667:       final private List<String> readonlyPaths;
710:       public List<String> getMaskedPaths() {
714:       public List<String> getReadonlyPaths() {
178:       return path;
181:     public OCILayer(String mediaType, String path) {
183:       this.path = path;
260:         return path;
270:       public OCIRootConfig(String path, boolean readonly) {
271:         this.path = path;
598:           return path;
613:         public HookType(String path, List<String> args, List<String> env,
615:           this.path = path;
757:         public Namespace(String type, String path) {
759:           this.path = path;
820:           return path;
843:         public Device(String type, String path, long major, long minor,
846:           this.path = path;
83:     return containerScriptPath;
87:     return containerCredentialsPath;
94:     return keystorePath;
97:     return truststorePath;
126:       String pidFile, String containerScriptPath,
127:       String containerCredentialsPath,
128:       int https, String keystorePath, String truststorePath,
133:         containerScriptPath, containerCredentialsPath, https, keystorePath,
134:         truststorePath, localDirs, logDirs,
140:       String pidFile, String containerScriptPath,
141:       String containerCredentialsPath,
142:       int https, String keystorePath, String truststorePath,
152:     this.containerScriptPath = containerScriptPath;
153:     this.containerCredentialsPath = containerCredentialsPath;
155:     this.keystorePath = keystorePath;
156:     this.truststorePath = truststorePath;
687:         return cgroupsPath;
725:           String cgroupsPath, Resources resources, IntelRdt intelRdt,
733:         this.cgroupsPath = cgroupsPath;
711:         return maskedPaths;
715:         return readonlyPaths;
727:           List<String> maskedPaths, List<String> readonlyPaths,
739:         this.maskedPaths = maskedPaths;
740:         this.readonlyPaths = readonlyPaths;
github.com/apache/hadoop:hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java: [ trunk, ]
2180:     private final Path path;
408:   protected static FileSystem getFSofPath(final Path absOrFqPath,
745:   protected void checkPath(Path path) {
926:    public Path resolvePath(final Path p) throws IOException {
996:   public final PathHandle getPathHandle(FileStatus stat, HandleOpt... opt) {
1011:   protected PathHandle createPathHandle(FileStatus stat, HandleOpt... opt) {
3293:   public boolean hasPathCapability(final Path path, final String capability)
208:   private final Set<Path> deleteOnExit = new TreeSet<>();
256:       conf.get(CommonConfigurationKeys.KERBEROS_TICKET_CACHE_PATH);
542:       conf.get(CommonConfigurationKeys.KERBEROS_TICKET_CACHE_PATH);
626:    * Qualify a path to one which uses this FileSystem and, if relative,
628:    * @param path to qualify.
629:    * @return this path if it contains a scheme and authority and is absolute, or
630:    * a new path that includes a path and authority and is fully qualified
631:    * @see Path#makeQualified(URI, Path)
632:    * @throws IllegalArgumentException if the path has a schema/URI different
635:   public Path makeQualified(Path path) {
636:     checkPath(path);
637:     return path.makeQualified(this.getUri(), this.getWorkingDirectory());
696:       Path file, FsPermission permission) throws IOException {
709:    * @see #create(FileSystem, Path, FsPermission)
717:   public static boolean mkdirs(FileSystem fs, Path dir, FsPermission permission)
735:    * Check that a Path belongs to this FileSystem.
740:    * @param path to check
741:    * @throws IllegalArgumentException if the path is not considered to be
746:     Preconditions.checkArgument(path != null, "null path");
747:     URI uri = path.toUri();
757:       if (thatAuthority == null &&                // path's authority is null
763:           uri = null; // can't determine auth of the path
776:     throw new IllegalArgumentException("Wrong FS: " + path +
865:    * of passing the {@code FileStatus} of the path to
868:    * @param p path is used to identify an FS since an FS could have
872:    * @throws FileNotFoundException when the path does not exist
875:   public BlockLocation[] getFileBlockLocations(Path p,
888:    * @deprecated use {@link #getServerDefaults(Path)} instead
909:    * @param p path is used to identify an FS since an FS could have
914:   public FsServerDefaults getServerDefaults(Path p) throws IOException {
919:    * Return the fully-qualified path of path, resolving the path
921:    * @param p path to be resolved
922:    * @return fully qualified path
923:    * @throws FileNotFoundException if the path is not present
932:    * Opens an FSDataInputStream at the indicated Path.
937:   public abstract FSDataInputStream open(Path f, int bufferSize)
941:    * Opens an FSDataInputStream at the indicated Path.
945:   public FSDataInputStream open(Path f) throws IOException {
988:    * @param opt If absent, assume {@link HandleOpt#path()}.
1000:       return createPathHandle(stat, HandleOpt.path());
1016:    * Create an FSDataOutputStream at the indicated Path.
1021:   public FSDataOutputStream create(Path f) throws IOException {
1026:    * Create an FSDataOutputStream at the indicated Path.
1032:   public FSDataOutputStream create(Path f, boolean overwrite)
1042:    * Create an FSDataOutputStream at the indicated Path with write-progress
1049:   public FSDataOutputStream create(Path f, Progressable progress)
1059:    * Create an FSDataOutputStream at the indicated Path.
1065:   public FSDataOutputStream create(Path f, short replication)
1075:    * Create an FSDataOutputStream at the indicated Path with write-progress
1083:   public FSDataOutputStream create(Path f, short replication,
1093:    * Create an FSDataOutputStream at the indicated Path.
1095:    * @param overwrite if a path with this name already exists, then if true,
1100:   public FSDataOutputStream create(Path f,
1110:    * Create an {@link FSDataOutputStream} at the indicated Path
1114:    * @param f the path of the file to open
1120:   public FSDataOutputStream create(Path f,
1132:    * Create an FSDataOutputStream at the indicated Path.
1140:   public FSDataOutputStream create(Path f,
1149:    * Create an FSDataOutputStream at the indicated Path with write-progress
1158:   public FSDataOutputStream create(Path f,
1171:    * Create an FSDataOutputStream at the indicated Path with write-progress
1182:    * @see #setPermission(Path, FsPermission)
1184:   public abstract FSDataOutputStream create(Path f,
1193:    * Create an FSDataOutputStream at the indicated Path with write-progress
1203:    * @see #setPermission(Path, FsPermission)
1205:   public FSDataOutputStream create(Path f,
1217:    * Create an FSDataOutputStream at the indicated Path with a custom
1229:    * @see #setPermission(Path, FsPermission)
1231:   public FSDataOutputStream create(Path f,
1254:   protected FSDataOutputStream primitiveCreate(Path f,
1286:    * @param f path
1290:    * @see #mkdirs(Path, FsPermission)
1293:   protected boolean primitiveMkdir(Path f, FsPermission absolutePermission)
1307:   protected void primitiveMkdir(Path f, FsPermission absolutePermission,
1332:    * Opens an FSDataOutputStream at the indicated Path with write-progress
1343:    * @see #setPermission(Path, FsPermission)
1345:   public FSDataOutputStream createNonRecursive(Path f,
1354:    * Opens an FSDataOutputStream at the indicated Path with write-progress
1366:    * @see #setPermission(Path, FsPermission)
1368:    public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
1378:     * Opens an FSDataOutputStream at the indicated Path with write-progress
1389:     * @see #setPermission(Path, FsPermission)
1391:     public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
1399:    * Creates the given Path as a brand-new zero-length file.  If
1402:    * @param f path to use for create
1405:   public boolean createNewFile(Path f) throws IOException {
1425:   public FSDataOutputStream append(Path f) throws IOException {
1439:   public FSDataOutputStream append(Path f, int bufferSize) throws IOException {
1452:   public abstract FSDataOutputStream append(Path f, int bufferSize,
1457:    * @param trg the path to the target destination.
1463:   public void concat(final Path trg, final Path [] psrcs) throws IOException {
1471:    * @deprecated Use {@link #getFileStatus(Path)} instead
1474:    * @throws FileNotFoundException if the path does not resolve.
1478:   public short getReplication(Path src) throws IOException {
1494:   public boolean setReplication(Path src, short replication)
1500:    * Renames Path src to Path dst.
1501:    * @param src path to be renamed
1502:    * @param dst new path after rename
1506:   public abstract boolean rename(Path src, Path dst) throws IOException;
1509:    * Renames Path src to Path dst
1531:    * @param src path to be renamed
1532:    * @param dst new path after rename
1533:    * @throws FileNotFoundException src path does not exist, or the parent
1534:    * path of dst does not exist.
1535:    * @throws FileAlreadyExistsException dest path exists and is a file
1536:    * @throws ParentNotDirectoryException if the parent path of dest is not
1541:   protected void rename(final Path src, final Path dst,
1583:       final Path parent = dst.getParent();
1600:    * Truncate the file in the indicated path to the indicated size.
1602:    *   <li>Fails if path is a directory.</li>
1603:    *   <li>Fails if path does not exist.</li>
1604:    *   <li>Fails if path is not closed.</li>
1607:    * @param f The path to the file to be truncated
1620:   public boolean truncate(Path f, long newLength) throws IOException {
1627:    * @deprecated Use {@link #delete(Path, boolean)} instead.
1630:   public boolean delete(Path f) throws IOException {
1636:    * @param f the path to delete.
1637:    * @param recursive if path is a directory and set to
1643:   public abstract boolean delete(Path f, boolean recursive) throws IOException;
1646:    * Mark a path to be deleted when its FileSystem is closed.
1654:    * The path must exist in the filesystem at the time of the method call;
1668:    * @param f the path to delete.
1672:   public boolean deleteOnExit(Path f) throws IOException {
1683:    * Cancel the scheduled deletion of the path when the FileSystem is closed.
1684:    * @param f the path to cancel deletion
1685:    * @return true if the path was found in the delete-on-exit list.
1687:   public boolean cancelDeleteOnExit(Path f) {
1703:       for (Iterator<Path> iter = deleteOnExit.iterator(); iter.hasNext();) {
1704:         Path path = iter.next();
1706:           if (exists(path)) {
1707:             delete(path, true);
1711:           LOGGER.info("Ignoring failure to deleteOnExit for path {}", path);
1718:   /** Check if a path exists.
1721:    * {@link #getFileStatus(Path)} calls, as this will involve multiple redundant
1724:    * @param f source path
1725:    * @return true if the path exists
1728:   public boolean exists(Path f) throws IOException {
1736:   /** True iff the named path is a directory.
1740:    * @param f path to check
1742:    * @deprecated Use {@link #getFileStatus(Path)} instead
1745:   public boolean isDirectory(Path f) throws IOException {
1753:   /** True iff the named path is a regular file.
1755:    * returned by {@link #getFileStatus(Path)} or listStatus() methods.
1757:    * @param f path to check
1759:    * @deprecated Use {@link #getFileStatus(Path)} instead
1762:   public boolean isFile(Path f) throws IOException {
1773:    * @deprecated Use {@link #getFileStatus(Path)} instead.
1774:    * @throws FileNotFoundException if the path does not resolve
1778:   public long getLength(Path f) throws IOException {
1782:   /** Return the {@link ContentSummary} of a given {@link Path}.
1783:    * @param f path to use
1784:    * @throws FileNotFoundException if the path does not resolve
1787:   public ContentSummary getContentSummary(Path f) throws IOException {
1811:   /** Return the {@link QuotaUsage} of a given {@link Path}.
1812:    * @param f path to use
1816:   public QuotaUsage getQuotaUsage(Path f) throws IOException {
1821:    * Set quota for the given {@link Path}.
1823:    * @param src the target path to set quota for
1829:   public void setQuota(Path src, final long namespaceQuota,
1835:    * Set per storage type quota for the given {@link Path}.
1837:    * @param src the target path to set storage type quota for
1842:   public void setQuotaByStorageType(Path src, final StorageType type,
1852:       public boolean accept(Path file) {
1858:    * List the statuses of the files/directories in the given path if the path is
1865:    * @param f given path
1867:    * @throws FileNotFoundException when the path does not exist
1870:   public abstract FileStatus[] listStatus(Path f) throws FileNotFoundException,
1878:    * {@link FileSystem#listStatusBatch(Path, byte[])} to implement iterative
1916:    * use the generic {@link FileSystem#listStatusIterator(Path)} implementation.
1917:    * @param f Path to list
1925:   protected DirectoryEntries listStatusBatch(Path f, byte[] token) throws
1935:    * Filter files/directories in the given path using the user-supplied path
1937:    * @throws FileNotFoundException when the path does not exist
1940:   private void listStatus(ArrayList<FileStatus> results, Path f,
1953:    * @return an iterator over the corrupt files under the given path
1959:   public RemoteIterator<Path> listCorruptFileBlocks(Path path)
1966:    * Filter files/directories in the given path using the user-supplied path
1973:    *          a path name
1975:    *          the user-supplied path filter
1976:    * @return an array of FileStatus objects for the files under the given path
1978:    * @throws FileNotFoundException when the path does not exist
1981:   public FileStatus[] listStatus(Path f, PathFilter filter)
1990:    * path filter.
1998:    *         applying the filter default Path filter
1999:    * @throws FileNotFoundException when the path does not exist
2002:   public FileStatus[] listStatus(Path[] files)
2009:    * path filter.
2017:    *          the user-supplied path filter
2020:    * @throws FileNotFoundException when the path does not exist
2023:   public FileStatus[] listStatus(Path[] files, PathFilter filter)
2083:    * @param pathPattern a glob specifying a path pattern
2085:    * @return an array of paths that match the path pattern
2088:   public FileStatus[] globStatus(Path pathPattern) throws IOException {
2098:    * Return an array of {@link FileStatus} objects whose path names match
2099:    * {@code pathPattern} and is accepted by the user-supplied path filter.
2100:    * Results are sorted by their path names.
2102:    * @param pathPattern a glob specifying the path pattern
2103:    * @param filter a user-supplied path filter
2104:    * @return null if {@code pathPattern} has no glob and the path does not exist
2105:    *         an empty array if {@code pathPattern} has a glob and no path
2110:   public FileStatus[] globStatus(Path pathPattern, PathFilter filter)
2116:    * List the statuses of the files/directories in the given path if the path is
2118:    * Return the file's status and block locations If the path is a file.
2122:    * @param f is the path
2125:    *         in the given path
2130:   public RemoteIterator<LocatedFileStatus> listLocatedStatus(final Path f)
2138:    * The results are filtered by the given path filter
2139:    * @param f a path
2140:    * @param filter a path filter
2142:    *         in the given path
2146:   protected RemoteIterator<LocatedFileStatus> listLocatedStatus(final Path f,
2165:         // calling getFileStatus(Path) to load the FileStatus again
2175:    * Generic iterator for implementing {@link #listStatusIterator(Path)}.
2184:     DirListingIterator(Path path) throws IOException {
2185:       this.path = path;
2186:       this.entries = listStatusBatch(path, null);
2197:       entries = listStatusBatch(path, token);
2221:    * @param p target path
2226:   public RemoteIterator<FileStatus> listStatusIterator(final Path p)
2232:    * List the statuses and block locations of the files in the given path.
2237:    * If the path is a directory,
2239:    *   if recursive is true, return files in the subtree rooted at the path.
2240:    * If the path is a file, return the file's status and block locations.
2242:    * @param f is the path
2247:    * @throws FileNotFoundException when the path does not exist;
2251:       final Path f, final boolean recursive)
2305:   public Path getHomeDirectory() {
2315:         new Path(USER_HOME_PREFIX + "/" + username));
2323:    * @param new_dir Path of new working directory
2325:   public abstract void setWorkingDirectory(Path new_dir);
2331:   public abstract Path getWorkingDirectory();
2345:   protected Path getInitialWorkingDirectory() {
2350:    * Call {@link #mkdirs(Path, FsPermission)} with default permission.
2351:    * @param f path
2355:   public boolean mkdirs(Path f) throws IOException {
2363:    * @param f path to create
2367:   public abstract boolean mkdirs(Path f, FsPermission permission
2373:    * @param src path
2374:    * @param dst path
2377:   public void copyFromLocalFile(Path src, Path dst)
2386:    * @param dst path
2389:   public void moveFromLocalFile(Path[] srcs, Path dst)
2397:    * @param src local path
2398:    * @param dst path
2401:   public void moveFromLocalFile(Path src, Path dst)
2411:    * @param src path
2412:    * @param dst path
2414:   public void copyFromLocalFile(boolean delSrc, Path src, Path dst)
2426:    * @param dst path
2430:                                 Path[] srcs, Path dst)
2442:    * @param src path
2443:    * @param dst path
2447:                                 Path src, Path dst)
2455:    * @param src path src file in the remote filesystem
2456:    * @param dst path local destination
2459:   public void copyToLocalFile(Path src, Path dst) throws IOException {
2466:    * @param src path src file in the remote filesystem
2467:    * @param dst path local destination
2470:   public void moveToLocalFile(Path src, Path dst) throws IOException {
2478:    * @param src path src file in the remote filesystem
2479:    * @param dst path local destination
2482:   public void copyToLocalFile(boolean delSrc, Path src, Path dst)
2498:    *          path
2500:    *          path
2506:   public void copyToLocalFile(boolean delSrc, Path src, Path dst,
2521:    * and the local working file path.
2524:    * @param fsOutputFile path of output file
2525:    * @param tmpLocalFile path of local tmp file
2528:   public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
2539:    * @param fsOutputFile path of output file
2540:    * @param tmpLocalFile path to local tmp file
2543:   public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile)
2551:    * through calls to {@link #deleteOnExit(Path)}, and remove this FS instance
2570:     Path path = new Path("/");
2571:     return getUsed(path);
2575:    * Return the total size of all files from a specified path.
2578:   public long getUsed(Path path) throws IOException {
2579:     return getContentSummary(path).getLength();
2586:    * @deprecated Use {@link #getFileStatus(Path)} instead
2587:    * @throws FileNotFoundException if the path is not present
2591:   public long getBlockSize(Path f) throws IOException {
2598:    * @deprecated use {@link #getDefaultBlockSize(Path)} instead
2608:    * be split into to minimize I/O time.  The given path will be used to
2609:    * locate the actual filesystem.  The full path does not have to exist.
2610:    * @param f path of file
2611:    * @return the default block size for the path's filesystem
2613:   public long getDefaultBlockSize(Path f) {
2620:    * @deprecated use {@link #getDefaultReplication(Path)} instead
2626:    * Get the default replication for a path.
2627:    * The given path will be used to locate the actual FileSystem to query.
2628:    * The full path does not have to exist.
2629:    * @param path of the file