Advertisement: RazorSQL
Query, update, navigate, and manage all databases from one database
client with ease using RazorSQL, a database query tool, SQL Editor,
database navigator, and administraton tool.
Download a free trial today!
Advertisement: EditRocket
The text editor for programmers with coding tools and support for over 20 languages. Download a free trial today!
Java Source Code
ReadFile.java
This class reads a file line by line and stores each line as an element of a java.util.ArrayList. ReadFile uses the BufferedReader and FileReader classes of the java.io package.
FTPLogin.java
This class takes an IP address, username, and password and FTP's to the IP address specified. This example class simply logs in to the computer, executes a 'PWD' command, disconnects, and prints all output received. One could easily re-engineer this class to perform more complex FTP operations. FTPLogin uses the Socket class located in the java.net package and the BufferedReader, InputStreamReader, and PrintWriter classes of the java.io package.
PropertiesReader.java
This class uses the java.util.ResourceBundle class to read values from properties files. Included is an example "main", which shows how to use the PropertiesReader. PropertiesReader also allows for the use of different Locales.
Debugger.java
Debugger.java uses the java.lang.reflect package to aid in the debugging of classes. Debugger takes an object and a match string and then invokes all methods of the passed in object that include the match string. It then returns the output from the invoked methods. Debugger is especially useful for returning the output of the "get" methods of a particular object.