File System Management

Fed up with Java FileInputStream and the blocking read method? Then perhaps it is time to do something about it and avoid the dreaded wait for a blocking read.

Whether you worked on small-scale application or if you have developed enterprise-wide applications all of your life, at some point you've likely encountered the need to read a file. This has likely lead to your seeing the joys of the java.io package. While the package in itself is well designed and structured, it doesn’t solve a basic problem - the fact that you are dealing with a file system. As such your application's response time can be limited by the response time of the file system itself.


In the case of most local file systems that might not be a problem (though if you have a busy file system and some large reads you might start to feel it!), but it does become a problem for things like NFS or mapped drives. A lot of integrations with really old legacy systems are based on files exchanged on network paths. The hospitality industry (hotels, pubs and restaurants) in particular seems to be full of such systems that haven’t been changed since the 1980s. In such cases even though you might exchange just one kilobyte of data at a time, because you're dealing with a remote file system and in most cases a very busy one with anything from 50 to 100 such "message files" exchanged per minute and then propagated through the network, you’re occasionally looking at about 1-2 seconds for reading such a small file.


In a normal web-based application this might not be a problem because the user is used to waiting (however, even in such cases the attitude is beginning to shift!); however, it would be much nicer if instead of waiting in a InputStream.read() for the bytes to become available to your application, you were also doing something else in parallel. Sure you can turn your application execution flow around so that you only do the read at the end. In this case, the user experience suffers only in the last step - after you have offered a pretty smooth and fast experience throughout. However, this is not possible sometimes and even if it is, it doesn't eliminate the problem, but instead hides it behind the fact that most of the user actions have been responded in a timely-fashion and therefore the user will have more tolerance for such a "small" glitch at the end.


Read the Rest of this Article at Developer.com

Related Articles
- Java Discussion: "Programming assistance?"
We reach into our Discussions mailbag for a thread that may be of interest. Feel free to participate. Ask a question or offer some advice. Join your fellow Java developers in the Gamelan discussion forum. Registration is simple and free.
- Breaking the Sandbox Barrier, Part 1
- Don't Be a Slave of the File System
- User Code: A Little Socket App
- A Java Card Primer, Part 2
- Axis2 Information Model
- User Code: ReaderFile
- Disaster Recovery Through Project Management
- Securing Java Code: Part 3
- Tacit Records: The Java Class Loader
Regional Articles
- File System Management Alabama
- File System Management Alaska
- File System Management Arizona
- File System Management Arkansas
- File System Management California
- File System Management Colorado
- File System Management Connecticut
- File System Management DC
- File System Management Delaware
- File System Management Florida
- File System Management Georgia
- File System Management Hawaii
- File System Management Idaho
- File System Management Illinois
- File System Management Indiana
- File System Management Iowa
- File System Management Kansas
- File System Management Kentucky
- File System Management Louisiana
- File System Management Maine
- File System Management Maryland
- File System Management Massachusetts
- File System Management Michigan
- File System Management Minnesota
- File System Management Mississippi
- File System Management Missouri
- File System Management Montana
- File System Management Nebraska
- File System Management Nevada
- File System Management New Hampshire
- File System Management New Jersey
- File System Management New Mexico
- File System Management New York
- File System Management North Carolina
- File System Management North Dakota
- File System Management Ohio
- File System Management Oklahoma
- File System Management Oregon
- File System Management Pennsylvania
- File System Management Rhode Island
- File System Management South Carolina
- File System Management South Dakota
- File System Management Tennessee
- File System Management Texas
- File System Management Utah
- File System Management Vermont
- File System Management Virginia
- File System Management Washington
- File System Management West Virginia
- File System Management Wisconsin
- File System Management Wyoming

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML