FileEditor.java .
FileEditor.java which will work
as a simple graphical editor of text files. Please feel free to add
any additional capabilities to your FileEditor, if you like it. You
can also change all AWT components to Swing components if you feel
adventurous. In order to attack this assignment successfully, you
will definitely need to use
Java2 API Documentation
to learn about java classes involved in the project.
Archiver.java .
java.util.zip package. These steams allow programmer
to compress/decompress files and directories. Your task is to
create a simple graphical Archiver program, similar
in spirit to well-known WinZip. Namely, your GUI program
should allow user to create a new ZIP archive and to specify
(using JFileChooser, perhaps) which files (but not directories) to
zip into newly created archive. It should then compress the specified
files into the zip archive. Furthermore, your program should be able
to open an existing archive and to add more files to it. As
an extra, if you fill adventurous, you are welcome to add an
ability to compress entire directories as well as (most importantly)
to extract files and/or directories from an archive, but this is
strictly optional.
TimeServer.java, TimeClient.java,
Time.html .
TimeServer class that acts as a server and
reports the current time to clients that connect to it. The server
should be multi-threaded, i.e. each client's request should be
processed by a new thread. The server should simply output the
current time and close the connection, without reading anything
from client. To test your server, you need to
create an applet TimeClient which would allow user
to inquire the server about the exact current time (kept by the
server). After connecting to the server and getting the server's
time stamp, the applet should display to user the difference
between server's current time and client's own time. User should be
able to repeat this server/client time synchronization as many
times as he/she wishes (without hitting browser's "reload" button).
LS.java, XLS.java .
LS that
lists all of the files and subdirectories in a specified directory,
along with their sizes and modification dates. By default, the
output should be sorted by name. If invoked with -s
option, however, output should be sorted by size from largest to
smallest. If invoked with -d option, output should
be sorted by date, from most recent to least. To invoke this
program, a user would issue a command of the following type:
> java LS > java LS directoryName > java LS -s directoryName > java LS -d directoryName(The first variant should give a listing for current directory.) Needless to say that your program MUST handle graciously all exceptions that might be thrown in it. In addition to the CLI program
LS, you need to write a GUI (Graphical
User Interface) program XLS, which should act as
a simple GUI front-end to LS. In other words,
XLS relies in its work on LS, which
does all the file sorting. XLS itself should not
do any sorting. XLS should let user interactively
specify type of sorting desired (via different GUI buttons,
for example), and then delegate creation of the sorted list to
LS. Once LS has created an appropriate
sorted listing, XLS should display it in a viewing area,
and then wait for another user's request. You must use Java
Collections Framework to do all the storage and sorting required
in your program.
SecureServer.java, GenericClient.java,
WriteService.java, ReadService.java, hw.policy .
SecureServer class that acts as a server and
starts services requested by clients that connect to it. The server
should be multi-threaded, i.e. each client's request should be
processed by a new thread. Moreover, all service threads should
belong to a separate Thread Group with restricted permissions -
its threads should be allowed read/write access only to a specified
directory on the server. In addition, service threads should be
unable to modify behavior of threads from any other group.
You need to create two service classes WriteService
and ReadService which you server will be able to load
dynamically on a client's request. WriteService should
allow client to write (save) a file on server. ReadService
should allow client to read a file kept on server.
Any client's reading/writing activities should be restricted to a
specified directory on the server. To test your server, you need to
create an applet GenericClient which would allow user
to connect to the server and to specify which service should be
started. Most likely you will need to set up a special policy file
hw.policy, in which you will grant a set of permissions
to your server (for example, a permission to accept connections...)
Finally, your server should log all incoming connections in a file
secureserver.log outside of the directory which is
accessible to service threads, i.e. this log file should be
unaccessible by service threads. In the log file you should record
only time/date and origin of each incoming connection.
/*
Your name
Your Student ID
Your e-mail address
I certify that the following represents my own independent work and
conforms with the guidelines of academic honesty described in the
course syllabus.
*/
Any homework submitted without this header will not be graded,
and you will receive zero credit for it.