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++;
}