Package net.datacrow.util

Examples of net.datacrow.util.Directory


   
    public boolean hasReports(int module) {
        String folder = folders.get(module);
        if (folder != null) {
            String[] extensions = {"xsl", "xslt"};
            Directory dir = new Directory(folder, true, extensions);
            Collection<String> files = dir.read();
            if (files.size() > 0) return true;
        }
        return false;
    }
View Full Code Here


        String folder = folders.get(module);
       
        Collection<ReportTemplate> reports = new ArrayList<ReportTemplate>();
        if (folder != null) {
            String[] extensions = {"xsl", "xslt"};
            Directory directory = new Directory(folder, true, extensions);
            Collection<String> files = directory.read();
            for (String filename : files) {
                ReportTemplate rf = new ReportTemplate(filename);
                if (rf.supports(transformer))
                    reports.add(rf);
            }
View Full Code Here

        super(Thread.currentThread().getContextClassLoader());
        init(path);
    }

    private void init(String path) {
        Directory dir = new Directory(DataCrow.servicesDir, true, new String[] {"jar"});
        for (String filename :  dir.read())
            jarFiles.add(new File(filename));
    }
View Full Code Here

    private void loadPlugins() {
        String check = File.separator + "plugins" + File.separator;
        Object[] params = new Object[] {null, null, -1, -1};
        PluginClassLoader cl = new PluginClassLoader(DataCrow.pluginsDir);
       
        Directory dir = new Directory(DataCrow.pluginsDir, true, new String[] {"class"});
        for (String filename : dir.read()) {
            try {
                String classname = filename.substring(filename.indexOf(check) + 1, filename.lastIndexOf('.'));
                classname = pattern.matcher(classname).replaceAll(".");
                Class<?> clazz = cl.loadClass(classname);
                Plugin plugin = (Plugin) clazz.getConstructors()[0].newInstance(params);
View Full Code Here

            File fl = new File(dataDir, file);
            if (!fl.isDirectory() && !file.endsWith(".log") && !file.equals("images"))
                files.add(fl.toString());
        }

        Directory dir = new Directory(DataCrow.resourcesDir, true, null);
        Collection<String> resources = dir.read();
        for (String resource : resources) {
            if (resource.toLowerCase().endsWith(DcLanguageResource.suffix))
                files.add(resource);
        }
       
        Directory directory = new Directory(DataCrow.moduleDir, true, null);
        files.addAll(directory.read());
        directory = new Directory(DataCrow.imageDir, true, new String[] {"jpg", "jpeg"});
        files.addAll(directory.read());       

        for (String reportDir : new ReportTemplates(true).getFolders()) {
            directory = new Directory(reportDir, true, new String[] {"xsl", "xslt"});
            files.addAll(directory.read());
        }
       
        return files;
    }
View Full Code Here

         
          // reports
          if (module.hasReports()) {
              String reportDir = DataCrow.reportDir + module.getName().toLowerCase().replaceAll("[/\\*%., ]", "");
             
                Directory dir = new Directory(reportDir, true, new String[] {"xsl, xslt"});
              for (String filename : dir.read()) {
                  byte[] content = Utilities.readFile(new File(filename));
                  String name = filename.substring(filename.indexOf(File.separator + "reports" + File.separator) + 9);
                        zf.addEntry(name, content);
              }
          }
View Full Code Here

            DcSwingUtilities.displayErrorMessage(DcResources.getText("msgSelectDirFirst"));
        } else {
           
            notifyTaskStarted();
           
            final Directory dir = new Directory(
                    directory.toString(),
                    cbRecursive.isSelected(),
                    filter != null ? filter.getExtensions() : null);
            dir.setListener(this);
           
            Thread task = new Thread(new Runnable() {
                @Override
                public void run() {
                    for (final String file : dir.read()) {
                        try {
                            SwingUtilities.invokeAndWait(
                                    new Thread(new Runnable() {
                                        @Override
                                        public void run() {
View Full Code Here

    public void add(Conversion conversion) {
        conversions.add(conversion);
    }

    public void load() {
        Directory directory = new Directory(
                DataCrow.installationDir + "upgrade",
                false,
                new String[] {"properties"});
       
        List<String> filenames = directory.read();
       
        // sort them in their natural order
        Collections.sort(filenames);

        for (String filename : filenames) {
View Full Code Here

                logger.info(DcResources.getText("msgModulesLoaded"));
       
                ValueEnhancers.initialize();
   
                // delete lock file
                Directory directory = new Directory(dataDir, false, new String[] {"lck"});
                for (String file : directory.read())
                  new File(file).delete();
               
                // set the database name
                DcSettings.set(DcRepository.Settings.stConnectionString, "dc");
                if (db != null && db.length() > 0)
View Full Code Here

            return;
       
        String directory = new File(filename).getParent();
        boolean recurse = settings.getBoolean(DcRepository.ModuleSettings.stImportLocalArtRecurse);
       
        Directory dir = new Directory(directory, recurse, new String[] {"jpg", "jpeg", "png", "gif"});
        Collection<String> files = dir.read();
        boolean frontSet = false;
        boolean backSet = false;
        boolean cdSet = false;
       
        for (String file : files) {
View Full Code Here

TOP

Related Classes of net.datacrow.util.Directory

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.