src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java
changeset 53363 20a872899315
parent 53043 fd2e8f941ded
child 54608 c604234be658
equal deleted inserted replaced
53362:ef09fd205ef0 53363:20a872899315
     1 /*
     1 /*
     2  * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    90             return zfs.getRootDir();
    90             return zfs.getRootDir();
    91         else
    91         else
    92             return null;
    92             return null;
    93     }
    93     }
    94 
    94 
    95    @Override
    95     @Override
    96     public Path getFileName() {
    96     public ZipPath getFileName() {
    97         int off = path.length;
    97         int off = path.length;
    98         if (off == 0 || off == 1 && path[0] == '/')
    98         if (off == 0 || off == 1 && path[0] == '/')
    99             return null;
    99             return null;
   100         while (--off >= 0 && path[off] != '/') {}
   100         while (--off >= 0 && path[off] != '/') {}
   101         if (off < 0)
   101         if (off < 0)