1902hw4writeup

1902hw4writeup - CSci 1902 Homework 4 Due 4:00pm(before...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSci 1902 – Homework 4 Due: March 25, 2010, 4:00pm (before class) Purpose In this individual homework assignment, you will obtain and sort a list of files while: Practicing the implementation of sorting algorithms Learning about the uses and benefits of Java’s Comparators Discovering how to display your information in a Graphical User Interface (GUI) Introduction As mass storage becomes larger and larger, we accumulate more and more files. Directories fill up with old assignments, pictures of friends and family, etc. You would like to archive some of your files on a remote backup service so that you don’t lose all of your data in a catastrophic event such as your house burning down or your computer being hit by an electromagnetic pulse. Online backup services provide lots of space, but not enough of it to copy all of your data without paying more money for a higher tier of service, so you need to be selective about what you backup. Therefore, you would like to generate a list of files you possess, sorted by some criteria. Perhaps you would like to only save files older than a year. Maybe you would like to save only mp3 files, or save everything except mp3 files. Or, you may wish to save only your largest files. The first thing you will need to do is gather a list of files and sort them by various criteria. In this assignment, you will be writing code to obtain a sorted list of files in a directory hierarchy. Getting started The files for this assignment are available on the course website at: http://www-users.itlabs.umn.edu/classes/Spring-2010/csci1902/homeworks/1902hw4.zip Download this archive to your computer (you may choose to save this in your NetBeansProjects directory, or in some other directory where you are collecting your Java programs) and unzip it. To unzip the archive in Linux, use the following command in a Terminal: unzip 1902hw4.zip The unzipped directory is a NetBeans project. Open the project in NetBeans by using the “Open Project…” menu, and selecting the 1902hw4 entry. The files included in this project are in a package in the src directory: FileListerFrame.java A JFrame GUI that will display file information FileObject.java A wrapper class for Java’s File that provides additional information Sorter.java The class containing the sorting routines TraverseFiles.java A class that recursively traverses files and directories for big and old files Note that most of the files provided are complete and you will not need to modify them. Familiarizing yourself with these classes can only help you to better understand and implement the task at hand.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Homework Submission Homework must be submitted electronically via the online-submission utility. You will find the link, “Submit Tool”, on the course website. Before submitting, create a
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2011 for the course CSCI 1902 taught by Professor Staff during the Spring '08 term at Minnesota.

Page1 / 5

1902hw4writeup - CSci 1902 Homework 4 Due 4:00pm(before...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online