CS 5741 - Programming Assignment 2

Due Tue Sep 29, 10 points

Introduction

In this programming assignment you will create a simple combined applet/application program that displays the contents of a program's resource directories. You will be using classes in the CS5741_Toolkit project that you set up earlier.

Thi intent of this assignment is to familiarize you with the use of a Visitor design pattern. This pattern has been already set up in the vfs (virtual file system) package of CS5741_Toolkit to escort a vistor through a virtual file system, visiting each directory and file. You will only need to implement a visitor by implementing the vfs.VFSVisitor interface.

The Programming Assignment

Your assignment is to create a program that just displays the names of directories and files in a virtual file system with indentation indicating the parent-child relationship. That is, the subdirectories and files in a directory are shown below the parent directory with an extra level of indentation. You essentially just creating a multiline String object that can be diplayed in a JTextArea.

The Virtual File System

The vfs package is designed to deal with either native or jarred file systems that are set up as part of a netbeans project. It allows you set up a resource directory under the source directory for your project and access its contents from your code. It works the same regardless of whether or not your code has been bundled into a jar file. The resource directory can contain any kind of files that you need for your program such as image files and html files. You can create a virtual file system just by passing the name of its root directory to the vfs.VFSRoot constructor. The ResourceViewer program illustrates the resource directory setup and its access.