< prev index next >

modules/jdk.packager/src/main/java/com/oracle/tools/packager/JreUtils.java

Print this page




  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.oracle.tools.packager;
  27 
  28 import java.io.File;
  29 import java.util.HashSet;
  30 import java.util.Set;
  31 

  32 public class JreUtils {
  33 
  34     public static class Rule {
  35         String regex;
  36         boolean includeRule;
  37         Type type;
  38         enum Type {SUFFIX, PREFIX, SUBSTR, REGEX}
  39 
  40         private Rule(String regex, boolean includeRule, Type type) {
  41             this.regex = regex;
  42             this.type = type;
  43             this.includeRule = includeRule;
  44         }
  45 
  46         boolean match(String str) {
  47             if (type == Type.SUFFIX) {
  48                 return str.endsWith(regex);
  49             }
  50             if (type == Type.PREFIX) {
  51                 return str.startsWith(regex);




  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.oracle.tools.packager;
  27 
  28 import java.io.File;
  29 import java.util.HashSet;
  30 import java.util.Set;
  31 
  32 @Deprecated
  33 public class JreUtils {
  34 
  35     public static class Rule {
  36         String regex;
  37         boolean includeRule;
  38         Type type;
  39         enum Type {SUFFIX, PREFIX, SUBSTR, REGEX}
  40 
  41         private Rule(String regex, boolean includeRule, Type type) {
  42             this.regex = regex;
  43             this.type = type;
  44             this.includeRule = includeRule;
  45         }
  46 
  47         boolean match(String str) {
  48             if (type == Type.SUFFIX) {
  49                 return str.endsWith(regex);
  50             }
  51             if (type == Type.PREFIX) {
  52                 return str.startsWith(regex);


< prev index next >