Examples of FilenameFilter


Examples of java.io.FilenameFilter

    public FontRecord[] getFontRecords() {
        String javaHome = System.getProperty("java.home");
        File fontDirectory = new File(javaHome + "/lib/fonts");
        // TTFReader ttfReader = new TTFReader();
        File[] children = fontDirectory.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.toLowerCase().endsWith(".ttf");
            }
        });
        if (children == null) {
View Full Code Here

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

Examples of java.io.FilenameFilter

        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

Examples of java.io.FilenameFilter

    }
   
    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

Examples of java.io.FilenameFilter

    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

Examples of java.io.FilenameFilter

    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

Examples of java.io.FilenameFilter

    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

Examples of java.io.FilenameFilter

    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

Examples of java.io.FilenameFilter

  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

Examples of java.io.FilenameFilter

  @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
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.