Examples of RegExpFilenameFilter


Examples of ch.cern.mig.utils.RegExpFilenameFilter

    long now = System.currentTimeMillis() / 1000;
    long oldtemp = now - maxTemp;
    long oldlock = now - maxLock;
    if (oldtemp > 0 || oldlock > 0) {
      for (File element : elements) {
        File[] inElements = element.listFiles(new RegExpFilenameFilter(
            Pattern.compile("\\."), false));
        if (inElements == null)
          continue;
        for (File inElement : inElements) {
          FileStat stat = null;
View Full Code Here

Examples of ch.cern.mig.utils.RegExpFilenameFilter

    @Override
    public boolean buildElements() {
      while (!dirs.isEmpty()) {
        String dir = dirs.remove(0);
        File[] content = new File(queue.path + File.separator + dir)
            .listFiles(new RegExpFilenameFilter(Queue.ElementRegexp));
        if (content == null || content.length == 0)
          continue;
        Arrays.sort(content);
        for (File element : content) {
          elts.add(dir + File.separator + element.getName());
View Full Code Here

Examples of com.mucommander.commons.file.filter.RegexpFilenameFilter

            CommandManager.registerDefaultCommand(new Command(CommandManager.FILE_OPENER_ALIAS,  FILE_OPENER_COMMAND, CommandType.SYSTEM_COMMAND, null));
            CommandManager.registerDefaultCommand(new Command(CommandManager.URL_OPENER_ALIAS,   FILE_OPENER_COMMAND, CommandType.SYSTEM_COMMAND, null));
            CommandManager.registerDefaultCommand(new Command(CommandManager.FILE_MANAGER_ALIAS, FILE_OPENER_COMMAND, CommandType.SYSTEM_COMMAND, EXPLORER_NAME));
            CommandManager.registerDefaultCommand(new Command(CommandManager.EXE_OPENER_ALIAS,   EXE_OPENER_COMMAND,  CommandType.SYSTEM_COMMAND, null));

            CommandManager.registerDefaultAssociation(CommandManager.EXE_OPENER_ALIAS, new RegexpFilenameFilter(EXE_REGEXP, false));
        }
        catch(CommandException e) {throw new DesktopInitialisationException(e);}
    }
View Full Code Here

Examples of com.mucommander.commons.file.filter.RegexpFilenameFilter

            // Identifies which kind of filter should be used to match executable files.
            if(JavaVersion.JAVA_1_6.isCurrentOrHigher())
                filter = new PermissionsFileFilter(PermissionTypes.EXECUTE_PERMISSION, true);
            else
            */
                filter = new RegexpFilenameFilter("[^.]+", true);

            CommandManager.registerDefaultAssociation(CommandManager.EXE_OPENER_ALIAS, filter);

            // Multi-click interval retrieval
            try {
View Full Code Here

Examples of com.mucommander.commons.file.filter.RegexpFilenameFilter

                    filter = new EqualsFilenameFilter(testString, caseSensitive);
                    break;
                case REGEXP:
                default:
                    try {
                        filter = new RegexpFilenameFilter(testString, caseSensitive);
                    }
                    catch(PatternSyntaxException ex) {
                        // Todo: let the user know the regexp is invalid
                        LOGGER.debug("Invalid regexp", ex);
View Full Code Here

Examples of com.mucommander.commons.file.filter.RegexpFilenameFilter

                builder.setIsExecutable(permissionFilter.getFilter());
                break;
            }
        }
        else if(filter instanceof RegexpFilenameFilter) {
            RegexpFilenameFilter regexpFilter;

            regexpFilter = (RegexpFilenameFilter)filter;
            builder.setMask(regexpFilter.getRegularExpression(), regexpFilter.isCaseSensitive());
        }
    }
View Full Code Here

Examples of com.mucommander.commons.file.filter.RegexpFilenameFilter

        // association mechanism.
        if(!filter.isEmpty())
            CommandManager.registerAssociation(command, filter);
    }

    public void setMask(String mask, boolean isCaseSensitive) {filter.addFileFilter(new RegexpFilenameFilter(mask, isCaseSensitive));}
View Full Code Here

Examples of org.jostraca.util.RegExpFileNameFilter

  public void testRecursiveSearch() throws Exception {
    File examples = new File( FileUtil.findFile( "org/jostraca" ), "../../../examples" );
    assertTrue( examples.exists() );

    GnuRegExpProvider rep   = new GnuRegExpProvider();
    File[]            files = FileUtil.recursiveSearch( examples, new RegExpFileNameFilter( rep.make( "^.*\\.txt$" ) ) );
    int               numF  = files.length;
    for( int fI = 0; fI < numF; fI++ ) {
      System.out.println( files[fI] );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.