Package java.io

Examples of java.io.File.listFiles()


    if (!mDefaultIconDir.exists()) {
      // If the default directory does not exist, try to find another icon theme in the icontheme directory
      File iconDir = new File("icons");
      if (iconDir.exists()) {
        File[] list = iconDir.listFiles();
        if (list.length > 0) {
          mDefaultIconDir = list[0]; // get the first directory
        }
      }
    }
View Full Code Here


        ProcessBuilderFactory.setProcessBuilderFactoryService(new ProcessBuilderFactoryServiceImpl());
        ProcessMarshallerFactory.setProcessMarshallerFactoryService(new ProcessMarshallerFactoryServiceImpl());
        ProcessRuntimeFactory.setProcessRuntimeFactoryService(new ProcessRuntimeFactoryServiceImpl());
        BPMN2ProcessFactory.setBPMN2ProcessProvider(new BPMN2ProcessProviderImpl());
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        for (File subfile: file.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
              return name.endsWith(".bpmn") || name.endsWith("bpmn2");
            }})) {
          System.out.println("Loading process from file system: " + subfile.getName());
          kbuilder.add(ResourceFactory.newFileResource(subfile), ResourceType.BPMN2);
View Full Code Here

      filDelete = new File(delFilePath);

      if (filDelete.exists()) {

        File[] strFiles = filDelete.listFiles();//lists the files and folders
        // of current directory

        if (strFiles != null) {

          for (int i = 0; i < strFiles.length; i++) {
View Full Code Here

    try {
      filDuplicate = new File(curWorkDir);

      if (filDuplicate.exists()) {
        File[] strFiles = filDuplicate.listFiles();

        for (int i = 0; i < strFiles.length; i++) {

          if (strFiles[i].isDirectory()) {
            curWorkPath = curWorkDir + strFiles[i].getName() + PATH_SEPERATOR;
View Full Code Here

*/
public class SameLevelDirSettingsFinderStrategy extends AbstractSettingsFileSearchStrategyTemplate {
    protected File findBeyondCurrentDir(StartParameter startParameter) {
        File parentDir = startParameter.getCurrentDir().getParentFile();
        if (parentDir != null && startParameter.isSearchUpwards()) {
            for (File potentialSameLevelDir : parentDir.listFiles()) {
                if (potentialSameLevelDir.isDirectory()) {
                    File settingsFile = new File(potentialSameLevelDir, Settings.DEFAULT_SETTINGS_FILE);
                    if (settingsFile.isFile()) {
                        return settingsFile;
                    }
View Full Code Here

    }

    final File templatesDir = new File(homeDir, "templates");
    if (templatesDir.exists())
    {
      final File[] reportFiles = templatesDir.listFiles(new FilesystemFilter(REPORT_EXTENSION, REPORT_EXTENSION, false));
      final List<String> templateNameList = new ArrayList<String>();
      for (final File file : reportFiles)
      {
        final String reportName = computeReportName(file);
        if (reportName == null)
View Full Code Here

    private static long getDirectoryLastModified(final String path) {
      final File pck = new File(System.getProperty("user.dir") + path);
      if ( !pck.exists() || !pck.isDirectory() )
        return Long.MAX_VALUE;

      final File[] classes = pck.listFiles(new FileFilter() {
        public boolean accept(final File pathname) {
          return pathname.isFile() && pathname.getName().endsWith(".class");
        }
      });
View Full Code Here

        File classesDir = new File(componentDir, "classes");
        if (classesDir.exists()) {
            list.add(classesDir.toURL());
        }
        File libDir = new File(componentDir, "lib");
        File[] jars = libDir.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".jar") || name.endsWith(".zip");
            }
        });
        if (jars != null) {
View Full Code Here

      return null;
   
    FSDirectory dir = localdp.getDirectory();
    File indexRoot = dir.getFile();
    if (key == null) {
      File[] subIndex = indexRoot.listFiles();
      for (File sub : subIndex) {
        localDirectoryToMap(sub.getName());
      }
      return localdp;
    }
View Full Code Here

    final HttpSession session = request.getSession();
    try {
      File cacheDirectory = new File(session.getServletContext()
          .getRealPath(
              ResourceCacheManager.getInstance().getCacheStorePath()));
      File[] files = cacheDirectory.listFiles();
      if(files == null)
        return;
     
      String key,fName;
      for(File file :files){
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.