Package java.io

Examples of java.io.FilenameFilter


        final File folder = new File(directory);
        if (!folder.exists()) {
            Log.logWarning("LanguageStatistics", "the language statistics folder " + directory + " cannot be found");
            return;
        }
        final FilenameFilter filter = new LanguageFilenameFilter();
        final File[] allLanguageFiles = folder.listFiles(filter);
       
        if (allLanguageFiles != null) {
            for (int i = 0; i < allLanguageFiles.length; i++) {
                if(allLanguageFiles[i].isFile()) {
View Full Code Here


        myBuildinfo.contextPut("patchesBaseTag", baseTag);
        myBuildinfo.contextPut("patches", patches);
       
        if (!patchesActive) {
          // find the active patch
          File[] allPatches = new File(WebappHelper.getContextRoot()).listFiles(new FilenameFilter() {

            /**
             * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
             */
            public boolean accept(File dir, String name) {
View Full Code Here

    }
   
    log.audit("search in: " + folder);

    String pathToFolder = folder.getAbsolutePath();
    String[] files = folder.list(new FilenameFilter() {

      @Override
      public boolean accept(File dir, String name) {
        return name.endsWith(".ics");
      }
View Full Code Here

    if (save && name != null) {
      fileDialog.setFile(new File(name).getName());
    }
   
    // Set supported files filter
    fileDialog.setFilenameFilter(new FilenameFilter() {
        public boolean accept(File dir, String name) {         
          return isAcceptable(new File(dir, name).toString(), contentType);
        }
      });
    // Update current directory
View Full Code Here

    String staticAbsPath = WebappHelper.getContextRoot() + "/static/themes";
    File themesDir = new File(staticAbsPath);
    if(!themesDir.exists()){
      logWarn("Themes dir not found: "+staticAbsPath, null);
    }
    File[] themes = themesDir.listFiles(new FilenameFilter() {
      public boolean accept(File dir, String name) {
        // remove files - only accept dirs
        if ( ! new File(dir, name).isDirectory()) return false;
        // remove unwanted meta-dirs
        if (name.equalsIgnoreCase("CVS")) return false;
View Full Code Here

    public static String[] getFilesByExt(String ld, String ext) {
        File dir = new File(ld);
        String[] names = null;
        final String lext = ext;
        if (dir.isDirectory()) {
            names = dir.list(new FilenameFilter() {
                public boolean accept(File d, String name) {
                    if (name.endsWith(lext)) {
                        return true;
                    }
                    return false;
View Full Code Here

    saveFile(targetDir, zipName, tmpDir, statisticFiles, email, "email.statistic", locale);
  */

  public File getLatestCourseStatisticFile(String targetDir) {
    File courseStatisticsDir = new File(targetDir);
    File[] exportedCourseStatisticZipFiles = courseStatisticsDir.listFiles(new FilenameFilter() {

      @Override
      public boolean accept(File dir, String name) {
        return name.startsWith(ExportManager.COURSE_STATISTIC) && name.endsWith(".zip");
      }
View Full Code Here

  private void searchForBrokenCourses(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
    if (!uhd.getBooleanDataValue(TASK_CLEANUP_BROKEN_COURSES)) {
     
      String bcRoot = FolderConfig.getCanonicalRoot();
      File courseFolder = new File(bcRoot+"/course");
      String[] courseFolderNames = courseFolder.list(new FilenameFilter() {
       
        @Override
        public boolean accept(File dir, String name) {
          try {
            Long.parseLong(name);
View Full Code Here

  @Override
  public void init() {
    final URL url = getClass().getClassLoader().getResource(scriptDir);
    if (url != null) {
      final File dir = new File(url.getFile());
      final String[] strs = dir.list(new FilenameFilter() {
        public boolean accept(final File dir, final String name) {
          return name.endsWith(".groovy");
        }
      });
View Full Code Here

  private boolean listScripts(final Player player, List<String> filterTerm) {
    // *.groovy scripts is in data/script/
    final File dirGroovy = new File(scriptDir);
    // *.class scripts is in data/script/games/stendhal/server/script/
    final File dirClasses = new File(scriptDir+"games/stendhal/server/script/");
    final String[] scriptsGroovy = dirGroovy.list(new FilenameFilter() {
        public boolean accept(final File dir, final String name) {
          return (name.endsWith(".groovy") && (name.indexOf('$') == -1));
        }
      });
    final String[] scriptsJava = dirClasses.list(new FilenameFilter(){
        public boolean accept(final File dir, final String name) {
          // remove filenames with '$' inside because they are inner classes
          return (name.endsWith(".class") && (name.indexOf('$') == -1));
        }
      });
View Full Code Here

TOP

Related Classes of java.io.FilenameFilter

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.