Repository navigation
Expand file tree
/
Copy pathPath.html
More file actions
1543 lines (1488 loc) · 83.7 KB
/
Copy pathPath.html
File metadata and controls
1543 lines (1488 loc) · 83.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Path (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.nio.file.Path interface">
<meta name="keywords" content="of()">
<meta name="keywords" content="getFileSystem()">
<meta name="keywords" content="isAbsolute()">
<meta name="keywords" content="getRoot()">
<meta name="keywords" content="getFileName()">
<meta name="keywords" content="getParent()">
<meta name="keywords" content="getNameCount()">
<meta name="keywords" content="getName()">
<meta name="keywords" content="subpath()">
<meta name="keywords" content="startsWith()">
<meta name="keywords" content="endsWith()">
<meta name="keywords" content="normalize()">
<meta name="keywords" content="resolve()">
<meta name="keywords" content="resolveSibling()">
<meta name="keywords" content="relativize()">
<meta name="keywords" content="toUri()">
<meta name="keywords" content="toAbsolutePath()">
<meta name="keywords" content="toRealPath()">
<meta name="keywords" content="toFile()">
<meta name="keywords" content="register()">
<meta name="keywords" content="iterator()">
<meta name="keywords" content="compareTo()">
<meta name="keywords" content="equals()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="toString()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Path (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":18,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":18,"i13":6,"i14":1,"i15":1,"i16":18,"i17":6,"i18":6,"i19":18,"i20":6,"i21":18,"i22":18,"i23":18,"i24":6,"i25":6,"i26":6,"i27":18,"i28":6,"i29":6,"i30":6};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Path.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span> <a href="../../../module-summary.html">java.base</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">java.nio.file</a></div>
<h2 title="Interface Path" class="title">Interface Path</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><code><a href="../../lang/Comparable.html" title="interface in java.lang">Comparable</a><<a href="Path.html" title="interface in java.nio.file">Path</a>></code>, <code><a href="../../lang/Iterable.html" title="interface in java.lang">Iterable</a><<a href="Path.html" title="interface in java.nio.file">Path</a>></code>, <code><a href="Watchable.html" title="interface in java.nio.file">Watchable</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">Path</span>
extends <a href="../../lang/Comparable.html" title="interface in java.lang">Comparable</a><<a href="Path.html" title="interface in java.nio.file">Path</a>>, <a href="../../lang/Iterable.html" title="interface in java.lang">Iterable</a><<a href="Path.html" title="interface in java.nio.file">Path</a>>, <a href="Watchable.html" title="interface in java.nio.file">Watchable</a></pre>
<div class="block">An object that may be used to locate a file in a file system. It will
typically represent a system dependent file path.
<p> A <code>Path</code> represents a path that is hierarchical and composed of a
sequence of directory and file name elements separated by a special separator
or delimiter. A <em>root component</em>, that identifies a file system
hierarchy, may also be present. The name element that is <em>farthest</em>
from the root of the directory hierarchy is the name of a file or directory.
The other name elements are directory names. A <code>Path</code> can represent a
root, a root and a sequence of names, or simply one or more name elements.
A <code>Path</code> is considered to be an <i>empty path</i> if it consists
solely of one name element that is empty. Accessing a file using an
<i>empty path</i> is equivalent to accessing the default directory of the
file system. <code>Path</code> defines the <a href="#getFileName()"><code>getFileName</code></a>,
<a href="#getParent()"><code>getParent</code></a>, <a href="#getRoot()"><code>getRoot</code></a>, and <a href="#subpath(int,int)"><code>subpath</code></a> methods to access the path components or a subsequence of its name
elements.
<p> In addition to accessing the components of a path, a <code>Path</code> also
defines the <a href="#resolve(java.nio.file.Path)"><code>resolve</code></a> and <a href="#resolveSibling(java.nio.file.Path)"><code>resolveSibling</code></a> methods to combine paths. The <a href="#relativize(java.nio.file.Path)"><code>relativize</code></a>
method that can be used to construct a relative path between two paths.
Paths can be <a href="#compareTo(java.nio.file.Path)"><code>compared</code></a>, and tested against each other using
the <a href="#startsWith(java.nio.file.Path)"><code>startsWith</code></a> and <a href="#endsWith(java.nio.file.Path)"><code>endsWith</code></a> methods.
<p> This interface extends <a href="Watchable.html" title="interface in java.nio.file"><code>Watchable</code></a> interface so that a directory
located by a path can be <a href="#register(java.nio.file.WatchService,java.nio.file.WatchEvent.Kind%5B%5D,java.nio.file.WatchEvent.Modifier...)"><code>registered</code></a> with a <a href="WatchService.html" title="interface in java.nio.file"><code>WatchService</code></a> and entries in the directory watched. </p>
<p> <b>WARNING:</b> This interface is only intended to be implemented by
those developing custom file system implementations. Methods may be added to
this interface in future releases. </p>
<h2>Accessing Files</h2>
<p> Paths may be used with the <a href="Files.html" title="class in java.nio.file"><code>Files</code></a> class to operate on files,
directories, and other types of files. For example, suppose we want a <a href="../../io/BufferedReader.html" title="class in java.io"><code>BufferedReader</code></a> to read text from a file "<code>access.log</code>". The
file is located in a directory "<code>logs</code>" relative to the current working
directory and is UTF-8 encoded.
<pre>
Path path = FileSystems.getDefault().getPath("logs", "access.log");
BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
</pre>
<a id="interop"></a><h2>Interoperability</h2>
<p> Paths associated with the default <a href="spi/FileSystemProvider.html" title="class in java.nio.file.spi"><code>provider</code></a> are generally interoperable
with the <a href="../../io/File.html" title="class in java.io"><code>java.io.File</code></a> class. Paths created by other
providers are unlikely to be interoperable with the abstract path names
represented by <code>java.io.File</code>. The <a href="../../io/File.html#toPath()"><code>toPath</code></a>
method may be used to obtain a <code>Path</code> from the abstract path name
represented by a <code>java.io.File</code> object. The resulting <code>Path</code> can
be used to operate on the same file as the <code>java.io.File</code> object. In
addition, the <a href="#toFile()"><code>toFile</code></a> method is useful to construct a <code>
File</code> from the <code>String</code> representation of a <code>Path</code>.
<h2>Concurrency</h2>
<p> Implementations of this interface are immutable and safe for use by
multiple concurrent threads.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.7</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t3" class="tableTab" onclick="show(4);">Abstract Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t5" class="tableTab" onclick="show(16);">Default Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compareTo(java.nio.file.Path)">compareTo</a></span>​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</code></th>
<td class="colLast">
<div class="block">Compares two abstract paths lexicographically.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>default boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#endsWith(java.lang.String)">endsWith</a></span>​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</code></th>
<td class="colLast">
<div class="block">Tests if this path ends with a <code>Path</code>, constructed by converting
the given path string, in exactly the manner specified by the <a href="#endsWith(java.nio.file.Path)"><code>endsWith(Path)</code></a> method.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#endsWith(java.nio.file.Path)">endsWith</a></span>​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</code></th>
<td class="colLast">
<div class="block">Tests if this path ends with the given path.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>​(<a href="../../lang/Object.html" title="class in java.lang">Object</a> other)</code></th>
<td class="colLast">
<div class="block">Tests this path for equality with the given object.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFileName()">getFileName</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the name of the file or directory denoted by this path as a
<code>Path</code> object.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="FileSystem.html" title="class in java.nio.file">FileSystem</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFileSystem()">getFileSystem</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the file system that created this object.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getName(int)">getName</a></span>​(int index)</code></th>
<td class="colLast">
<div class="block">Returns a name element of this path as a <code>Path</code> object.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNameCount()">getNameCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of name elements in the path.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getParent()">getParent</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the <em>parent path</em>, or <code>null</code> if this path does not
have a parent.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRoot()">getRoot</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the root component of this path as a <code>Path</code> object,
or <code>null</code> if this path does not have a root component.</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th>
<td class="colLast">
<div class="block">Computes a hash code for this path.</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAbsolute()">isAbsolute</a></span>()</code></th>
<td class="colLast">
<div class="block">Tells whether or not this path is absolute.</div>
</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code>default <a href="../../util/Iterator.html" title="interface in java.util">Iterator</a><<a href="Path.html" title="interface in java.nio.file">Path</a>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#iterator()">iterator</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns an iterator over the name elements of this path.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalize()">normalize</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a path that is this path with redundant name elements eliminated.</div>
</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>static <a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#of(java.lang.String,java.lang.String...)">of</a></span>​(<a href="../../lang/String.html" title="class in java.lang">String</a> first,
<a href="../../lang/String.html" title="class in java.lang">String</a>... more)</code></th>
<td class="colLast">
<div class="block">Returns a <code>Path</code> by converting a path string, or a sequence of
strings that when joined form a path string.</div>
</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>static <a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#of(java.net.URI)">of</a></span>​(<a href="../../net/URI.html" title="class in java.net">URI</a> uri)</code></th>
<td class="colLast">
<div class="block">Returns a <code>Path</code> by converting a URI.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>default <a href="WatchKey.html" title="interface in java.nio.file">WatchKey</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#register(java.nio.file.WatchService,java.nio.file.WatchEvent.Kind...)">register</a></span>​(<a href="WatchService.html" title="interface in java.nio.file">WatchService</a> watcher,
<a href="WatchEvent.Kind.html" title="interface in java.nio.file">WatchEvent.Kind</a><?>... events)</code></th>
<td class="colLast">
<div class="block">Registers the file located by this path with a watch service.</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code><a href="WatchKey.html" title="interface in java.nio.file">WatchKey</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#register(java.nio.file.WatchService,java.nio.file.WatchEvent.Kind%5B%5D,java.nio.file.WatchEvent.Modifier...)">register</a></span>​(<a href="WatchService.html" title="interface in java.nio.file">WatchService</a> watcher,
<a href="WatchEvent.Kind.html" title="interface in java.nio.file">WatchEvent.Kind</a><?>[] events,
<a href="WatchEvent.Modifier.html" title="interface in java.nio.file">WatchEvent.Modifier</a>... modifiers)</code></th>
<td class="colLast">
<div class="block">Registers the file located by this path with a watch service.</div>
</td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#relativize(java.nio.file.Path)">relativize</a></span>​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</code></th>
<td class="colLast">
<div class="block">Constructs a relative path between this path and a given path.</div>
</td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>default <a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#resolve(java.lang.String)">resolve</a></span>​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</code></th>
<td class="colLast">
<div class="block">Converts a given path string to a <code>Path</code> and resolves it against
this <code>Path</code> in exactly the manner specified by the <a href="#resolve(java.nio.file.Path)"><code>resolve</code></a> method.</div>
</td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#resolve(java.nio.file.Path)">resolve</a></span>​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</code></th>
<td class="colLast">
<div class="block">Resolve the given path against this path.</div>
</td>
</tr>
<tr class="rowColor" id="i21">
<td class="colFirst"><code>default <a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#resolveSibling(java.lang.String)">resolveSibling</a></span>​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</code></th>
<td class="colLast">
<div class="block">Converts a given path string to a <code>Path</code> and resolves it against
this path's <a href="#getParent()"><code>parent</code></a> path in exactly the manner
specified by the <a href="#resolveSibling(java.nio.file.Path)"><code>resolveSibling</code></a> method.</div>
</td>
</tr>
<tr class="altColor" id="i22">
<td class="colFirst"><code>default <a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#resolveSibling(java.nio.file.Path)">resolveSibling</a></span>​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</code></th>
<td class="colLast">
<div class="block">Resolves the given path against this path's <a href="#getParent()"><code>parent</code></a>
path.</div>
</td>
</tr>
<tr class="rowColor" id="i23">
<td class="colFirst"><code>default boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#startsWith(java.lang.String)">startsWith</a></span>​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</code></th>
<td class="colLast">
<div class="block">Tests if this path starts with a <code>Path</code>, constructed by converting
the given path string, in exactly the manner specified by the <a href="#startsWith(java.nio.file.Path)"><code>startsWith(Path)</code></a> method.</div>
</td>
</tr>
<tr class="altColor" id="i24">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#startsWith(java.nio.file.Path)">startsWith</a></span>​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</code></th>
<td class="colLast">
<div class="block">Tests if this path starts with the given path.</div>
</td>
</tr>
<tr class="rowColor" id="i25">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subpath(int,int)">subpath</a></span>​(int beginIndex,
int endIndex)</code></th>
<td class="colLast">
<div class="block">Returns a relative <code>Path</code> that is a subsequence of the name
elements of this path.</div>
</td>
</tr>
<tr class="altColor" id="i26">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toAbsolutePath()">toAbsolutePath</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a <code>Path</code> object representing the absolute path of this
path.</div>
</td>
</tr>
<tr class="rowColor" id="i27">
<td class="colFirst"><code>default <a href="../../io/File.html" title="class in java.io">File</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toFile()">toFile</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a <a href="../../io/File.html" title="class in java.io"><code>File</code></a> object representing this path.</div>
</td>
</tr>
<tr class="altColor" id="i28">
<td class="colFirst"><code><a href="Path.html" title="interface in java.nio.file">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toRealPath(java.nio.file.LinkOption...)">toRealPath</a></span>​(<a href="LinkOption.html" title="enum in java.nio.file">LinkOption</a>... options)</code></th>
<td class="colLast">
<div class="block">Returns the <em>real</em> path of an existing file.</div>
</td>
</tr>
<tr class="rowColor" id="i29">
<td class="colFirst"><code><a href="../../lang/String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the string representation of this path.</div>
</td>
</tr>
<tr class="altColor" id="i30">
<td class="colFirst"><code><a href="../../net/URI.html" title="class in java.net">URI</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toUri()">toUri</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a URI to represent this path.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Iterable">
<!-- -->
</a>
<h3>Methods declared in interface java.lang.<a href="../../lang/Iterable.html" title="interface in java.lang">Iterable</a></h3>
<code><a href="../../lang/Iterable.html#forEach(java.util.function.Consumer)">forEach</a>, <a href="../../lang/Iterable.html#spliterator()">spliterator</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="of(java.lang.String,java.lang.String...)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre class="methodSignature">static <a href="Path.html" title="interface in java.nio.file">Path</a> of​(<a href="../../lang/String.html" title="class in java.lang">String</a> first,
<a href="../../lang/String.html" title="class in java.lang">String</a>... more)</pre>
<div class="block">Returns a <code>Path</code> by converting a path string, or a sequence of
strings that when joined form a path string. If <code>more</code> does not
specify any elements then the value of the <code>first</code> parameter is
the path string to convert. If <code>more</code> specifies one or more
elements then each non-empty string, including <code>first</code>, is
considered to be a sequence of name elements and is joined to form a
path string. The details as to how the Strings are joined is provider
specific but typically they will be joined using the
<a href="FileSystem.html#getSeparator()"><code>name-separator</code></a> as the separator.
For example, if the name separator is "<code>/</code>" and
<code>getPath("/foo","bar","gus")</code> is invoked, then the path string
<code>"/foo/bar/gus"</code> is converted to a <code>Path</code>. A <code>Path</code>
representing an empty path is returned if <code>first</code> is the empty
string and <code>more</code> does not contain any non-empty strings.
<p> The <code>Path</code> is obtained by invoking the <a href="FileSystem.html#getPath(java.lang.String,java.lang.String...)"><code>getPath</code></a> method of the <a href="FileSystems.html#getDefault()"><code>default</code></a> <a href="FileSystem.html" title="class in java.nio.file"><code>FileSystem</code></a>.
<p> Note that while this method is very convenient, using it will imply
an assumed reference to the default <code>FileSystem</code> and limit the
utility of the calling code. Hence it should not be used in library code
intended for flexible reuse. A more flexible alternative is to use an
existing <code>Path</code> instance as an anchor, such as:
<pre><code>
Path dir = ...
Path path = dir.resolve("file");
</code></pre></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>first</code> - the path string or initial part of the path string</dd>
<dd><code>more</code> - additional strings to be joined to form the path string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting <code>Path</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="InvalidPathException.html" title="class in java.nio.file">InvalidPathException</a></code> - if the path string cannot be converted to a <code>Path</code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>11</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="FileSystem.html#getPath(java.lang.String,java.lang.String...)"><code>FileSystem.getPath(java.lang.String, java.lang.String...)</code></a></dd>
</dl>
</li>
</ul>
<a id="of(java.net.URI)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre class="methodSignature">static <a href="Path.html" title="interface in java.nio.file">Path</a> of​(<a href="../../net/URI.html" title="class in java.net">URI</a> uri)</pre>
<div class="block">Returns a <code>Path</code> by converting a URI.
<p> This method iterates over the <a href="spi/FileSystemProvider.html#installedProviders()"><code>installed</code></a> providers to locate the provider that is identified by the
URI <a href="../../net/URI.html#getScheme()"><code>scheme</code></a> of the given URI. URI schemes are
compared without regard to case. If the provider is found then its <a href="spi/FileSystemProvider.html#getPath(java.net.URI)"><code>getPath</code></a> method is invoked to convert the
URI.
<p> In the case of the default provider, identified by the URI scheme
"file", the given URI has a non-empty path component, and undefined query
and fragment components. Whether the authority component may be present
is platform specific. The returned <code>Path</code> is associated with the
<a href="FileSystems.html#getDefault()"><code>default</code></a> file system.
<p> The default provider provides a similar <em>round-trip</em> guarantee
to the <a href="../../io/File.html" title="class in java.io"><code>File</code></a> class. For a given <code>Path</code> <i>p</i> it
is guaranteed that
<blockquote><code>
Path.of(</code><i>p</i><code>.</code><a href="#toUri()"><code>toUri</code></a><code>()).equals(</code>
<i>p</i><code>.</code><a href="#toAbsolutePath()"><code>toAbsolutePath</code></a><code>())</code>
</blockquote>
so long as the original <code>Path</code>, the <code>URI</code>, and the new <code>
Path</code> are all created in (possibly different invocations of) the same
Java virtual machine. Whether other providers make any guarantees is
provider specific and therefore unspecified.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>uri</code> - the URI to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting <code>Path</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if preconditions on the <code>uri</code> parameter do not hold. The
format of the URI is provider specific.</dd>
<dd><code><a href="FileSystemNotFoundException.html" title="class in java.nio.file">FileSystemNotFoundException</a></code> - The file system, identified by the URI, does not exist and
cannot be created automatically, or the provider identified by
the URI's scheme component is not installed</dd>
<dd><code><a href="../../lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> - if a security manager is installed and it denies an unspecified
permission to access the file system</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>11</dd>
</dl>
</li>
</ul>
<a id="getFileSystem()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileSystem</h4>
<pre class="methodSignature"><a href="FileSystem.html" title="class in java.nio.file">FileSystem</a> getFileSystem()</pre>
<div class="block">Returns the file system that created this object.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file system that created this object</dd>
</dl>
</li>
</ul>
<a id="isAbsolute()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAbsolute</h4>
<pre class="methodSignature">boolean isAbsolute()</pre>
<div class="block">Tells whether or not this path is absolute.
<p> An absolute path is complete in that it doesn't need to be combined
with other path information in order to locate a file.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if, and only if, this path is absolute</dd>
</dl>
</li>
</ul>
<a id="getRoot()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRoot</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> getRoot()</pre>
<div class="block">Returns the root component of this path as a <code>Path</code> object,
or <code>null</code> if this path does not have a root component.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a path representing the root component of this path,
or <code>null</code></dd>
</dl>
</li>
</ul>
<a id="getFileName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileName</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> getFileName()</pre>
<div class="block">Returns the name of the file or directory denoted by this path as a
<code>Path</code> object. The file name is the <em>farthest</em> element from
the root in the directory hierarchy.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a path representing the name of the file or directory, or
<code>null</code> if this path has zero elements</dd>
</dl>
</li>
</ul>
<a id="getParent()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParent</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> getParent()</pre>
<div class="block">Returns the <em>parent path</em>, or <code>null</code> if this path does not
have a parent.
<p> The parent of this path object consists of this path's root
component, if any, and each element in the path except for the
<em>farthest</em> from the root in the directory hierarchy. This method
does not access the file system; the path or its parent may not exist.
Furthermore, this method does not eliminate special names such as "."
and ".." that may be used in some implementations. On UNIX for example,
the parent of "<code>/a/b/c</code>" is "<code>/a/b</code>", and the parent of
<code>"x/y/.</code>" is "<code>x/y</code>". This method may be used with the <a href="#normalize()"><code>normalize</code></a> method, to eliminate redundant names, for cases where
<em>shell-like</em> navigation is required.
<p> If this path has more than one element, and no root component, then
this method is equivalent to evaluating the expression:
<blockquote><pre>
subpath(0, getNameCount()-1);
</pre></blockquote></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a path representing the path's parent</dd>
</dl>
</li>
</ul>
<a id="getNameCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNameCount</h4>
<pre class="methodSignature">int getNameCount()</pre>
<div class="block">Returns the number of name elements in the path.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of elements in the path, or <code>0</code> if this path
only represents a root component</dd>
</dl>
</li>
</ul>
<a id="getName(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> getName​(int index)</pre>
<div class="block">Returns a name element of this path as a <code>Path</code> object.
<p> The <code>index</code> parameter is the index of the name element to return.
The element that is <em>closest</em> to the root in the directory hierarchy
has index <code>0</code>. The element that is <em>farthest</em> from the root
has index <a href="#getNameCount()"><code>count</code></a><code>-1</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - the index of the element</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the name element</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if <code>index</code> is negative, <code>index</code> is greater than or
equal to the number of elements, or this path has zero name
elements</dd>
</dl>
</li>
</ul>
<a id="subpath(int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>subpath</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> subpath​(int beginIndex,
int endIndex)</pre>
<div class="block">Returns a relative <code>Path</code> that is a subsequence of the name
elements of this path.
<p> The <code>beginIndex</code> and <code>endIndex</code> parameters specify the
subsequence of name elements. The name that is <em>closest</em> to the root
in the directory hierarchy has index <code>0</code>. The name that is
<em>farthest</em> from the root has index <a href="#getNameCount()"><code>count</code></a><code>-1</code>. The returned <code>Path</code> object has the name elements
that begin at <code>beginIndex</code> and extend to the element at index <code>
endIndex-1</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>beginIndex</code> - the index of the first element, inclusive</dd>
<dd><code>endIndex</code> - the index of the last element, exclusive</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new <code>Path</code> object that is a subsequence of the name
elements in this <code>Path</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if <code>beginIndex</code> is negative, or greater than or equal to
the number of elements. If <code>endIndex</code> is less than or
equal to <code>beginIndex</code>, or larger than the number of elements.</dd>
</dl>
</li>
</ul>
<a id="startsWith(java.nio.file.Path)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startsWith</h4>
<pre class="methodSignature">boolean startsWith​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</pre>
<div class="block">Tests if this path starts with the given path.
<p> This path <em>starts</em> with the given path if this path's root
component <em>starts</em> with the root component of the given path,
and this path starts with the same name elements as the given path.
If the given path has more name elements than this path then <code>false</code>
is returned.
<p> Whether or not the root component of this path starts with the root
component of the given path is file system specific. If this path does
not have a root component and the given path has a root component then
this path does not start with the given path.
<p> If the given path is associated with a different <code>FileSystem</code>
to this path then <code>false</code> is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the given path</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this path starts with the given path; otherwise
<code>false</code></dd>
</dl>
</li>
</ul>
<a id="startsWith(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startsWith</h4>
<pre class="methodSignature">default boolean startsWith​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</pre>
<div class="block">Tests if this path starts with a <code>Path</code>, constructed by converting
the given path string, in exactly the manner specified by the <a href="#startsWith(java.nio.file.Path)"><code>startsWith(Path)</code></a> method. On UNIX for example, the path
"<code>foo/bar</code>" starts with "<code>foo</code>" and "<code>foo/bar</code>". It
does not start with "<code>f</code>" or "<code>fo</code>".</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Requirements:</span></dt>
<dd>The default implementation is equivalent for this path to:
<pre><code>
startsWith(getFileSystem().getPath(other));
</code></pre></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the given path string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this path starts with the given path; otherwise
<code>false</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="InvalidPathException.html" title="class in java.nio.file">InvalidPathException</a></code> - If the path string cannot be converted to a Path.</dd>
</dl>
</li>
</ul>
<a id="endsWith(java.nio.file.Path)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>endsWith</h4>
<pre class="methodSignature">boolean endsWith​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</pre>
<div class="block">Tests if this path ends with the given path.
<p> If the given path has <em>N</em> elements, and no root component,
and this path has <em>N</em> or more elements, then this path ends with
the given path if the last <em>N</em> elements of each path, starting at
the element farthest from the root, are equal.
<p> If the given path has a root component then this path ends with the
given path if the root component of this path <em>ends with</em> the root
component of the given path, and the corresponding elements of both paths
are equal. Whether or not the root component of this path ends with the
root component of the given path is file system specific. If this path
does not have a root component and the given path has a root component
then this path does not end with the given path.
<p> If the given path is associated with a different <code>FileSystem</code>
to this path then <code>false</code> is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the given path</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this path ends with the given path; otherwise
<code>false</code></dd>
</dl>
</li>
</ul>
<a id="endsWith(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>endsWith</h4>
<pre class="methodSignature">default boolean endsWith​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</pre>
<div class="block">Tests if this path ends with a <code>Path</code>, constructed by converting
the given path string, in exactly the manner specified by the <a href="#endsWith(java.nio.file.Path)"><code>endsWith(Path)</code></a> method. On UNIX for example, the path
"<code>foo/bar</code>" ends with "<code>foo/bar</code>" and "<code>bar</code>". It does
not end with "<code>r</code>" or "<code>/bar</code>". Note that trailing separators
are not taken into account, and so invoking this method on the <code>
Path</code>"<code>foo/bar</code>" with the <code>String</code> "<code>bar/</code>" returns
<code>true</code>.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Requirements:</span></dt>
<dd>The default implementation is equivalent for this path to:
<pre><code>
endsWith(getFileSystem().getPath(other));
</code></pre></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the given path string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this path ends with the given path; otherwise
<code>false</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="InvalidPathException.html" title="class in java.nio.file">InvalidPathException</a></code> - If the path string cannot be converted to a Path.</dd>
</dl>
</li>
</ul>
<a id="normalize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalize</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> normalize()</pre>
<div class="block">Returns a path that is this path with redundant name elements eliminated.
<p> The precise definition of this method is implementation dependent but
in general it derives from this path, a path that does not contain
<em>redundant</em> name elements. In many file systems, the "<code>.</code>"
and "<code>..</code>" are special names used to indicate the current directory
and parent directory. In such file systems all occurrences of "<code>.</code>"
are considered redundant. If a "<code>..</code>" is preceded by a
non-"<code>..</code>" name then both names are considered redundant (the
process to identify such names is repeated until it is no longer
applicable).
<p> This method does not access the file system; the path may not locate
a file that exists. Eliminating "<code>..</code>" and a preceding name from a
path may result in the path that locates a different file than the original
path. This can arise when the preceding name is a symbolic link.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting path or this path if it does not contain
redundant name elements; an empty path is returned if this path
does not have a root component and all name elements are redundant</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getParent()"><code>getParent()</code></a>,
<a href="#toRealPath(java.nio.file.LinkOption...)"><code>toRealPath(java.nio.file.LinkOption...)</code></a></dd>
</dl>
</li>
</ul>
<a id="resolve(java.nio.file.Path)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolve</h4>
<pre class="methodSignature"><a href="Path.html" title="interface in java.nio.file">Path</a> resolve​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</pre>
<div class="block">Resolve the given path against this path.
<p> If the <code>other</code> parameter is an <a href="#isAbsolute()"><code>absolute</code></a>
path then this method trivially returns <code>other</code>. If <code>other</code>
is an <i>empty path</i> then this method trivially returns this path.
Otherwise this method considers this path to be a directory and resolves
the given path against this path. In the simplest case, the given path
does not have a <a href="#getRoot()"><code>root</code></a> component, in which case this method
<em>joins</em> the given path to this path and returns a resulting path
that <a href="#endsWith(java.nio.file.Path)"><code>ends</code></a> with the given path. Where the given path has
a root component then resolution is highly implementation dependent and
therefore unspecified.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the path to resolve against this path</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting path</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#relativize(java.nio.file.Path)"><code>relativize(java.nio.file.Path)</code></a></dd>
</dl>
</li>
</ul>
<a id="resolve(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolve</h4>
<pre class="methodSignature">default <a href="Path.html" title="interface in java.nio.file">Path</a> resolve​(<a href="../../lang/String.html" title="class in java.lang">String</a> other)</pre>
<div class="block">Converts a given path string to a <code>Path</code> and resolves it against
this <code>Path</code> in exactly the manner specified by the <a href="#resolve(java.nio.file.Path)"><code>resolve</code></a> method. For example, suppose that the name
separator is "<code>/</code>" and a path represents "<code>foo/bar</code>", then
invoking this method with the path string "<code>gus</code>" will result in
the <code>Path</code> "<code>foo/bar/gus</code>".</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Requirements:</span></dt>
<dd>The default implementation is equivalent for this path to:
<pre><code>
resolve(getFileSystem().getPath(other));
</code></pre></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the path string to resolve against this path</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting path</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="InvalidPathException.html" title="class in java.nio.file">InvalidPathException</a></code> - if the path string cannot be converted to a Path.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="FileSystem.html#getPath(java.lang.String,java.lang.String...)"><code>FileSystem.getPath(java.lang.String, java.lang.String...)</code></a></dd>
</dl>
</li>
</ul>
<a id="resolveSibling(java.nio.file.Path)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolveSibling</h4>
<pre class="methodSignature">default <a href="Path.html" title="interface in java.nio.file">Path</a> resolveSibling​(<a href="Path.html" title="interface in java.nio.file">Path</a> other)</pre>
<div class="block">Resolves the given path against this path's <a href="#getParent()"><code>parent</code></a>
path. This is useful where a file name needs to be <i>replaced</i> with
another file name. For example, suppose that the name separator is
"<code>/</code>" and a path represents "<code>dir1/dir2/foo</code>", then invoking
this method with the <code>Path</code> "<code>bar</code>" will result in the <code>
Path</code> "<code>dir1/dir2/bar</code>". If this path does not have a parent path,
or <code>other</code> is <a href="#isAbsolute()"><code>absolute</code></a>, then this method
returns <code>other</code>. If <code>other</code> is an empty path then this method
returns this path's parent, or where this path doesn't have a parent, the
empty path.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Requirements:</span></dt>
<dd>The default implementation is equivalent for this path to:
<pre><code>
(getParent() == null) ? other : getParent().resolve(other);
</code></pre>
unless <code>other == null</code>, in which case a
<code>NullPointerException</code> is thrown.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - the path to resolve against this path's parent</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting path</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#resolve(java.nio.file.Path)"><code>resolve(Path)</code></a></dd>
</dl>
</li>
</ul>
<a id="resolveSibling(java.lang.String)">
<!-- -->
</a>