Package java.io

Examples of java.io.File.list()


                            pattern = path.substring(split+1);
                        }
                    }
                    filter.setPattern(pattern);
                    s_logger.debug("Matching file names to command line pattern '" + path + '\'');
                    String[] matches = dir.list(filter);
                    if (matches == null || matches.length == 0) {
                        errors.add("No files found matching command line pattern '" + pattern +
                            "' in directory " + dir.getAbsolutePath());
                    } else {
                        for (int i = 0; i < matches.length; i++) {
View Full Code Here


     * Retrieves all the files to be backed up.
     * @return A collection of fully classified filenames.
     */
    private Collection<String> getFiles() {
        File dataDir = new File(DataCrow.dataDir);
        String[] list = dataDir.list();
        Collection<String>  files = new ArrayList<String> ();
        for (int i = 0; i < list.length; i++) {
            String file = list[i];
            File fl = new File(dataDir, file);
            if (!fl.isDirectory() && !file.endsWith(".log") && !file.equals("images"))
View Full Code Here

                      zf.addEntry(module.getTableName() + ".xml", data);
                     
                      // get the images
                      File imgPath = new File(parent.getPath(), module.getTableName() + "_images");
                      if (imgPath.exists()) {
                          for (String image : imgPath.list()) {
                             
                              if (canceled) break;
                             
                              // add the image
                              File imgFile = new File(imgPath.toString(), image);
View Full Code Here

     * @throws InvalidModuleXmlException
     * @throws ModuleJarException
     */
    private static void loadModuleJars() throws ModuleUpgradeException, InvalidModuleXmlException, ModuleJarException  {
        File file = new File(DataCrow.moduleDir);
        String[] files = file.list(new FileNameFilter("jar", false));
       
        Collection<XmlModule> dependingMods = new ArrayList<XmlModule>();
        Collection<XmlModule> masterMods = new ArrayList<XmlModule>();
       
        if (files == null) return;
View Full Code Here

    private void init(String path) {
        this.path = path;
        //find all JAR files on the path and subdirectories
        File f = new File(path);
        String[] list = f.list();
        if (list == null)
            return;
        for (int i = 0; i < list.length; i++) {
            f = new File(path, list[i]);
            if (f.isDirectory()) {
View Full Code Here

        if (list == null)
            return;
        for (int i = 0; i < list.length; i++) {
            f = new File(path, list[i]);
            if (f.isDirectory()) {
                String[] innerlist = f.list();
                if (innerlist == null)
                    continue;
                for (int j = 0; j < innerlist.length; j++) {
                    File g = new File(f, innerlist[j]);
                    if (g.isFile())
View Full Code Here

            }
        } catch (Exception e) {}

        //try subfolders
        resFile = new File(path);
        String[] list = resFile.list();
        if (list != null) {
            for (int i = 0; i < list.length; i++) {
                resFile = new File(path, list[i]);
                if (resFile.isDirectory()) {
                    try {
View Full Code Here

        if (is != null)
            return is;

        //try subdirectories
        resFile = new File(path);
        String[] list = resFile.list();
        if (list != null) {
            for (int i = 0; i < list.length; i++) {
                resFile = new File(path, list[i]);
                if (resFile.isDirectory()) {
                    try {
View Full Code Here

        }
    }

    private byte[] loadFromSubdirectory(String path, String name) {
        File f = new File(path);
        String[] list = f.list();
        if (list != null) {
            for (int i = 0; i < list.length; i++) {
                f = new File(path, list[i]);
                if (f.isDirectory()) {
                    byte[] buf = loadIt(path + list[i], name);
View Full Code Here

           
            if (tempFile.isDirectory()) {
                logger.debug(DcResources.getText("msgReadingFrom", current));
                sendMessageToListener(DcResources.getText("msgReadingFrom", current));

                String[] list = tempFile.list();
                if (list != null) {
                   
                    for (int j = 0; j < list.length; j++) {
                       
                        if (listener != null) listener.notifyProcessed();
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.