Package com.dotcms.repackage.org.apache.oro.text.regex

Examples of com.dotcms.repackage.org.apache.oro.text.regex.Perl5Compiler


  static {
    new Timer().schedule(new FileResourceCacheCleaner(), 1000  * 60 * Config.getIntProperty("WEBDAV_CLEAR_RESOURCE_CACHE_FRECUENCY", 10), 1000  * 60 * Config.getIntProperty("WEBDAV_CLEAR_RESOURCE_CACHE_FRECUENCY", 10));
  }

  public DotWebdavHelper() {
    Perl5Compiler c = new Perl5Compiler();
    try{
      tempResourcePattern = c.compile("/\\(.*\\)|/._\\(.*\\)|/\\.|^\\.|^\\(.*\\)",Perl5Compiler.READ_ONLY_MASK);
      }catch (MalformedPatternException mfe) {
        Logger.fatal(this,"Unable to instaniate webdav servlet : " + mfe.getMessage(),mfe);
      Logger.error(this,mfe.getMessage(),mfe);
    }

View Full Code Here


    // region's name for the cache
    private String[] groupNames = {primaryGroup,menuGroup,missGroup};
   
    public DotResourceCache() {
      cache = CacheLocator.getCacheAdministrator();
      Perl5Compiler c = new Perl5Compiler();
      try{
        assetPattern = c.compile("[/\\\\][0-9a-zA-Z][/\\\\][0-9a-zA-Z][/\\\\][0-9a-zA-Z-]*\\.[a-zA-Z]*",Perl5Compiler.READ_ONLY_MASK);
        menuPattern = c.compile("dynamic[/\\\\]menus[/\\\\].*",Perl5Compiler.READ_ONLY_MASK);
      }catch (MalformedPatternException mfe) {
        Logger.fatal(this,"Unable to instaniate dotCMS Velocity Cache",mfe);
      Logger.error(this,mfe.getMessage(),mfe);
    }
  }
View Full Code Here

  }

  protected boolean matchFilter(Folder folder, String fileName) {
    // return value
    Perl5Matcher p5m = new Perl5Matcher();
    Perl5Compiler p5c = new Perl5Compiler();
    boolean match = false;
    try {
      // Obtain the filters
      String filesMasks = folder.getFilesMasks();
      filesMasks = (filesMasks != null ? filesMasks.trim() : filesMasks);

      if (UtilMethods.isSet(filesMasks)) {
        String[] filesMasksArray = filesMasks.split(",");
        int length = filesMasksArray.length;

        // Try to match de filters
        for (int i = 0; i < length; i++) {
          String regex = filesMasksArray[i];
          regex = regex.replace(".", "\\.");
          regex = regex.replace("*", ".*");
          regex = "^" + regex.trim() + "$";
          Pattern pattern = p5c.compile(regex, Perl5Compiler.CASE_INSENSITIVE_MASK);
          match = match || p5m.matches(fileName, pattern);
          if (match) {
            break;
          }
        }
View Full Code Here

  private Perl5Compiler compiler;
 
  private Map<String, com.dotcms.repackage.org.apache.oro.text.regex.Pattern> patterns = new HashMap<String, com.dotcms.repackage.org.apache.oro.text.regex.Pattern>();
 
  private RegEX() {
    compiler = new Perl5Compiler();
  }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.oro.text.regex.Perl5Compiler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.