Examples of ZipFileFilter


Examples of com.darkhonor.rage.libs.ZipFileFilter

                            tempPath = nPath.concat(File.separator);
                            tempPath = tempPath.concat(stuIter.getWebID());
                            try
                            {
                                rootDir = new File(tempPath).getCanonicalFile();
                                files = rootDir.listFiles(new ZipFileFilter());
                                for (File file : files)
                                {
                                    RageLib.unZip(file.getParent(), file.getName(), true);
                                    counter++;
                                }
                            } catch (IOException ex)
                            {
                                LOGGER.error("Invalid Path: " + newPath);
                            }
                        }
                    }
                    JOptionPane.showMessageDialog(null, "Unzipped " + counter
                            + " file(s).",
                            "Information", JOptionPane.INFORMATION_MESSAGE);
                    LOGGER.info("Unzipped " + counter + " files.");
                }
            } else if ((cboInstructor.getSelectedIndex() > 0)
                    && (cboSection.getSelectedIndex() == 0)
                    && (cboStudent.getSelectedIndex() < 0))
            {  // Instructor and All Sections is selected, no student selected
                LOGGER.debug("Unzipping all assignments for instructor: "
                        + instructor.getLastName() + ", " + instructor.getFirstName());
                for (Section sectIter : instructor.getSections())
                {
                    LOGGER.debug("Unzipping section: " + sectIter.getName());
                    String newPath = new String();
                    newPath = path.concat(File.separator);
                    newPath = newPath.concat(sectIter.getName());
                    for (Student stuIter : sectIter.getStudents())
                    {
                        String tempPath = new String();
                        tempPath = newPath.concat(File.separator);
                        tempPath = tempPath.concat(stuIter.getWebID());
                        try
                        {
                            rootDir = new File(tempPath).getCanonicalFile();
                            files = rootDir.listFiles(new ZipFileFilter());
                            for (File file : files)
                            {
                                RageLib.unZip(file.getParent(), file.getName(), true);
                                counter++;
                            }
                        } catch (IOException ex)
                        {
                            LOGGER.error("Invalid Path: " + newPath);
                        }
                    }
                }
                JOptionPane.showMessageDialog(null, "Unzipped " + counter + " file(s).",
                        "Information", JOptionPane.INFORMATION_MESSAGE);
                LOGGER.info("Unzipped " + counter + " files.");
            } else if ((cboSection.getSelectedIndex() > 0)
                    && (cboStudent.getSelectedIndex() == 0))
            {  // Section is selected and All Students is selected
                // sect is my Section
                LOGGER.debug("Unzipping all students in section " + section.getName());
                for (Student stuIter : section.getStudents())
                {
                    String newPath = new String();
                    newPath = path.concat(File.separator);
                    newPath = newPath.concat(stuIter.getWebID());
                    try
                    {
                        rootDir = new File(newPath).getCanonicalFile();
                        files = rootDir.listFiles(new ZipFileFilter());
                        for (File file : files)
                        {
                            RageLib.unZip(file.getParent(), file.getName(), true);
                            counter++;
                        }
                    } catch (IOException ex)
                    {
                        LOGGER.error("Invalid Path: " + newPath);
                    }
                }
                JOptionPane.showMessageDialog(null, "Unzipped " + counter + " file(s).",
                        "Information", JOptionPane.INFORMATION_MESSAGE);
                LOGGER.info("Unzipped " + counter + " files.");
            } else if (cboStudent.getSelectedIndex() > 0)
            {  // An individual student is selected
                LOGGER.debug("Unzipping a single student");
                try
                {
                    rootDir = new File(path).getCanonicalFile();
                    files = rootDir.listFiles(new ZipFileFilter());
                    for (File file : files)
                    {
                        RageLib.unZip(file.getParent(), file.getName(), true);
                        counter++;
                    }
View Full Code Here

Examples of de.chris_soft.nanodoa.gui.ZipFileFilter

      fileChooser.setCurrentDirectory(initialPath);
    }
    fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
    fileChooser.setDialogTitle("Save document(s) as ZIP file");
    fileChooser.setSelectedFile(new File("documents.zip"));
    FileFilter zipFileFilter = new ZipFileFilter();
    fileChooser.setFileFilter(zipFileFilter);
    if (fileChooser.showSaveDialog(parent) == JFileChooser.APPROVE_OPTION) {
      return fileChooser.getSelectedFile();
    }
    return null;
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.