/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be <code>null</code>. * @param str The path to match, as a String. Must not be <code>null</code>. * @return <code>true</code> if the pattern matches against the string, or <code>false</code> otherwise. */ protected static boolean matchPath( String pattern, String str ) { return SelectorUtils.matchPath( pattern, str ); }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be <code>null</code>. * @param str The path to match, as a String. Must not be <code>null</code>. * @param isCaseSensitive Whether or not matching should be performed case sensitively. * @return <code>true</code> if the pattern matches against the string, or <code>false</code> otherwise. */ protected static boolean matchPath( String pattern, String str, boolean isCaseSensitive ) { return SelectorUtils.matchPath( pattern, str, isCaseSensitive ); }
private boolean isMatch( List<String> patterns, String name ) { for ( String pattern1 : patterns ) { if ( SelectorUtils.matchPath( pattern1, name, isCaseSensitive ) ) { return true; } } return false; }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be <code>null</code>. * @param str The path to match, as a String. Must not be <code>null</code>. * @return <code>true</code> if the pattern matches against the string, or <code>false</code> otherwise. */ public static boolean matchPath( String pattern, String str ) { return matchPath( pattern, str, true ); }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be <code>null</code>. * @param str The path to match, as a String. Must not be <code>null</code>. * @param isCaseSensitive Whether or not matching should be performed case sensitively. * @return <code>true</code> if the pattern matches against the string, or <code>false</code> otherwise. */ public static boolean matchPath( String pattern, String str, boolean isCaseSensitive ) { return matchPath( pattern, str, File.separator, isCaseSensitive ); }
private static boolean isIgnored(String name, Collection<String> ignoredPatterns) { for (String pattern : ignoredPatterns) { if (SelectorUtils.matchPath(pattern, name, false)) { return true; } } return false; } }
private boolean matchPaths( Set<String> patterns, String classFile ) { for ( String pattern : patterns ) { if ( SelectorUtils.matchPath( pattern, classFile ) ) { return true; } } return false; }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be * <code>null</code>. * @param str The path to match, as a String. Must not be * <code>null</code>. * * @return <code>true</code> if the pattern matches against the string, * or <code>false</code> otherwise. */ protected static boolean matchPath( String pattern, String str ) { return SelectorUtils.matchPath( pattern, str ); }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be * <code>null</code>. * @param str The path to match, as a String. Must not be * <code>null</code>. * * @return <code>true</code> if the pattern matches against the string, * or <code>false</code> otherwise. */ public static boolean matchPath( String pattern, String str ) { return matchPath( pattern, str, true ); }
private boolean isExcluded( String path ) { if ( excludes != null && !excludes.isEmpty() ) { for ( String exclude : excludes ) { if ( SelectorUtils.matchPath( exclude, path, true ) ) { return true; } } } return false; }
/** * Tests, whether the given pattern is matching the given name. * @param pattern The pattern to match * @param name The name to test * @param isCaseSensitive Whether the pattern is case sensitive. * @return True, if the pattern matches, otherwise false */ protected boolean matchPath( @Nonnull String pattern, @Nonnull String name, boolean isCaseSensitive ) { return SelectorUtils.matchPath( pattern, name, isCaseSensitive ); }
private boolean isIncluded( String path ) { if ( includes != null && !includes.isEmpty() ) { for ( String include : includes ) { if ( SelectorUtils.matchPath( include, path, true ) ) { return true; } } return false; } return true; }
private boolean isMatch( List patterns, String name ) { Iterator it = patterns.iterator(); while ( it.hasNext() ) { String pattern = (String) it.next(); if ( SelectorUtils.matchPath( pattern, name, isCaseSensitive ) ) { return true; } } return false; }
private static boolean matches(String entry, String[] patterns) { entry = replaceFileSeparator(entry); for (int i = 0; i < patterns.length; i++) { String pattern = replaceFileSeparator(patterns[i].trim()); if (SelectorUtils.matchPath(pattern, entry)) { return true; } } return false; }
protected String getFileName(final String sourceFile) { String extension = FileUtils.extension(sourceFile); String[] matchingExtensionFiles = scanFor(extension); for (String matchingExtensionFile : matchingExtensionFiles) { if (SelectorUtils.matchPath("**/" + sourceFile, matchingExtensionFile, true)) { return matchingExtensionFile; } } return sourceFile; }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be <code>null</code>. * @param str The path to match, as a String. Must not be <code>null</code>. * @param isCaseSensitive Whether or not matching should be performed case sensitively. * @return <code>true</code> if the pattern matches against the string, or <code>false</code> * otherwise. */ protected static boolean matchPath(String pattern, String str, boolean isCaseSensitive) { return SelectorUtils.matchPath(PathUtils.convertPathForOS(pattern), PathUtils.convertPathForOS(str), isCaseSensitive); }
protected boolean isExcluded( String file ) { getLogger().debug("isExcluded " + file + "?"); if ( excludes != null ) { for ( String exclude : excludes) { //replace ; with / because file with be in the form //fullpath of folder;ClassName.as (or .mxml) if ( SelectorUtils.matchPath(exclude, file.replace(';', File.separatorChar)) ) { return true; } } } return false; }
protected String getFileName(final String sourceFile) { String extension = FileUtils.extension(sourceFile); String[] matchingExtensionFiles = scanFor(extension); for (String matchingExtensionFile : matchingExtensionFiles) { if (SelectorUtils.matchPath("**/" + sourceFile, matchingExtensionFile, true)) { return matchingExtensionFile; } } return sourceFile; }
/** * Tests whether or not a given path matches a given pattern. * * @param pattern The pattern to match against. Must not be <code>null</code>. * @param str The path to match, as a String. Must not be <code>null</code>. * @param isCaseSensitive Whether or not matching should be performed case sensitively. * @return <code>true</code> if the pattern matches against the string, or <code>false</code> * otherwise. */ protected static boolean matchPath( String pattern, String str, boolean isCaseSensitive ) { return SelectorUtils.matchPath( PathUtils.convertPathForOS( pattern ), PathUtils.convertPathForOS( str ), isCaseSensitive ); }