    All Examples

# package examples.io

##

- FileBrowser
- HelloWorld
- SpeedTrap

# about this package

The standalone examples in this directory illustrate the WebLogic File API.

- In the HelloWorld example, a client uses WebLogic File to write "HelloWorld" to a T3FileOutputStream to create a file on WebLogic Server, and then uses a T3FileInputStream to read it back and display it.

- The SpeedTrap example writes and reads a 10MB file to WebLogic Server, and measures the data transfer rate.

- The FileBrowser is a small command-line application that lets you browse a registered WebLogic file system. The list of commands that you can use is on the FileBrowser page.

# how to use this package

1. Set up your development environment as described in Setting your development environment.

2. In your development shell, compile the files in this directory to your CLIENT_CLASSES directory, with a command like this one for Windows NT:

         $ javac -d %CLIENT_CLASSES% *.java

3. Set up a registered fileSystem in your weblogic.properties file by adding the weblogic.io.fileSystem property. You register a virtual name that the WebLogic Server maps to a real path that is valid on the server host. For example, to map the virtual name "mySys" to "c:\temp", you would add this property:

         weblogic.io.fileSystem.mySys=c:/temp

   Note the use of the forward slash--the Java convention--instead of a backwards slash. For more info on this property, check the Administrators Guide, Setting WebLogic properties.

4. Start your WebLogic Server in your server shell.

5. From your development shell, execute each example individually. You can type "java" plus the full package name to see a usage message on the arguments that each example requires.

   For example, here's how you run the FileBrowser example from the command line of the same machine as your WebLogic Server, listening on port 7001, with a registered fileSystem called "mySys":

         $ java examples.io.FileBrowser t3://localhost:7001 mySys

   With the FileBrowser example, you get a prompt that matches the name of your registered file system. You can toggle back and forth between your local file system and the WebLogic Server registered file system with the FileBrowser command "cf #" and "cf [fileSystem]". Type a question mark (?) to see a list of commands available in the FileBrowser.

# there's more . . .

Read the Developers Guide, Using WebLogic File Services, to get more detailed information for your application.