modules/jdk.packager/src/main/java/com/sun/javafx/tools/resource/DetailedResourceTraversal.java

Print this page




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.tools.resource;
  27 
  28 import java.io.File;
  29 




  30 public abstract class DetailedResourceTraversal implements ResourceTraversal {
  31     private String lastRelativePath;
  32 
  33     private boolean lastIsDirectory;
  34 
  35     public DetailedResourceTraversal() {
  36         lastRelativePath = "";
  37         lastIsDirectory = true;
  38     }
  39 
  40     public final boolean traverse(final PackagerResource rootResource,
  41                                   final File file,
  42                                   final String relativePath) {
  43         final boolean isDirectory = file.isDirectory();
  44         if (!traverseBetween(lastRelativePath, lastIsDirectory,
  45                              relativePath, isDirectory)) {
  46             return false;
  47         }
  48 
  49         lastRelativePath = relativePath;




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.tools.resource;
  27 
  28 import java.io.File;
  29 
  30 /**
  31  * @deprecated use {@link ToolProvider} to locate the {@code "javapackager"} tool instead.
  32  */
  33 @Deprecated(since="10", forRemoval=true)
  34 public abstract class DetailedResourceTraversal implements ResourceTraversal {
  35     private String lastRelativePath;
  36 
  37     private boolean lastIsDirectory;
  38 
  39     public DetailedResourceTraversal() {
  40         lastRelativePath = "";
  41         lastIsDirectory = true;
  42     }
  43 
  44     public final boolean traverse(final PackagerResource rootResource,
  45                                   final File file,
  46                                   final String relativePath) {
  47         final boolean isDirectory = file.isDirectory();
  48         if (!traverseBetween(lastRelativePath, lastIsDirectory,
  49                              relativePath, isDirectory)) {
  50             return false;
  51         }
  52 
  53         lastRelativePath = relativePath;