src/java.base/unix/classes/java/io/UnixFileSystem.java
changeset 53018 8bf9268df0e2
parent 52902 e3398b2e1ab0
child 54273 f0490ada4712
equal deleted inserted replaced
53017:e10a1f7aaa13 53018:8bf9268df0e2
    96         if (prevChar == '/') return normalize(pathname, n, n - 1);
    96         if (prevChar == '/') return normalize(pathname, n, n - 1);
    97         return pathname;
    97         return pathname;
    98     }
    98     }
    99 
    99 
   100     public int prefixLength(String pathname) {
   100     public int prefixLength(String pathname) {
   101         if (pathname.length() == 0) return 0;
   101         if (pathname.isEmpty()) return 0;
   102         return (pathname.charAt(0) == '/') ? 1 : 0;
   102         return (pathname.charAt(0) == '/') ? 1 : 0;
   103     }
   103     }
   104 
   104 
   105     public String resolve(String parent, String child) {
   105     public String resolve(String parent, String child) {
   106         if (child.isEmpty()) return parent;
   106         if (child.isEmpty()) return parent;
   247     public native int getBooleanAttributes0(File f);
   247     public native int getBooleanAttributes0(File f);
   248 
   248 
   249     public int getBooleanAttributes(File f) {
   249     public int getBooleanAttributes(File f) {
   250         int rv = getBooleanAttributes0(f);
   250         int rv = getBooleanAttributes0(f);
   251         String name = f.getName();
   251         String name = f.getName();
   252         boolean hidden = (name.length() > 0) && (name.charAt(0) == '.');
   252         boolean hidden = !name.isEmpty() && name.charAt(0) == '.';
   253         return rv | (hidden ? BA_HIDDEN : 0);
   253         return rv | (hidden ? BA_HIDDEN : 0);
   254     }
   254     }
   255 
   255 
   256     public native boolean checkAccess(File f, int access);
   256     public native boolean checkAccess(File f, int access);
   257     public native long getLastModifiedTime(File f);
   257     public native long getLastModifiedTime(File f);