< prev index next >

src/java.base/windows/classes/sun/nio/fs/WindowsFileSystem.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD


 201     }
 202 
 203     // supported views
 204     private static final Set<String> supportedFileAttributeViews = Collections
 205         .unmodifiableSet(new HashSet<String>(Arrays.asList("basic", "dos", "acl", "owner", "user")));
 206 
 207     @Override
 208     public Set<String> supportedFileAttributeViews() {
 209         return supportedFileAttributeViews;
 210     }
 211 
 212     @Override
 213     public final Path getPath(String first, String... more) {
 214         String path;
 215         if (more.length == 0) {
 216             path = first;
 217         } else {
 218             StringBuilder sb = new StringBuilder();
 219             sb.append(first);
 220             for (String segment: more) {
 221                 if (segment.length() > 0) {
 222                     if (sb.length() > 0)
 223                         sb.append('\\');
 224                     sb.append(segment);
 225                 }
 226             }
 227             path = sb.toString();
 228         }
 229         return WindowsPath.parse(this, path);
 230     }
 231 
 232     @Override
 233     public UserPrincipalLookupService getUserPrincipalLookupService() {
 234         return LookupService.instance;
 235     }
 236 
 237     private static class LookupService {
 238         static final UserPrincipalLookupService instance =
 239             new UserPrincipalLookupService() {
 240                 @Override
 241                 public UserPrincipal lookupPrincipalByName(String name)




 201     }
 202 
 203     // supported views
 204     private static final Set<String> supportedFileAttributeViews = Collections
 205         .unmodifiableSet(new HashSet<String>(Arrays.asList("basic", "dos", "acl", "owner", "user")));
 206 
 207     @Override
 208     public Set<String> supportedFileAttributeViews() {
 209         return supportedFileAttributeViews;
 210     }
 211 
 212     @Override
 213     public final Path getPath(String first, String... more) {
 214         String path;
 215         if (more.length == 0) {
 216             path = first;
 217         } else {
 218             StringBuilder sb = new StringBuilder();
 219             sb.append(first);
 220             for (String segment: more) {
 221                 if (!segment.isEmpty()) {
 222                     if (sb.length() > 0)
 223                         sb.append('\\');
 224                     sb.append(segment);
 225                 }
 226             }
 227             path = sb.toString();
 228         }
 229         return WindowsPath.parse(this, path);
 230     }
 231 
 232     @Override
 233     public UserPrincipalLookupService getUserPrincipalLookupService() {
 234         return LookupService.instance;
 235     }
 236 
 237     private static class LookupService {
 238         static final UserPrincipalLookupService instance =
 239             new UserPrincipalLookupService() {
 240                 @Override
 241                 public UserPrincipal lookupPrincipalByName(String name)


< prev index next >