# Codehaus Cargo : Coding Tips

Created by Adrian Cole, last modified on Feb 10, 2009

# Coding Tips

The following tips will help you along while coding Cargo containers

## File I/O

### FileHandler

FileHandler exposes many methods that you will need to implement Cargo containers and configurations. Its default implementation VFSFileHandler supports temporary filesystems and can be used in unit tests. Here is some guidance with regards to usage of this class.

#### Watch your file type!

The following method will corrupt binary files. Please do not use this method unless your source is a text file.

void copyFile(String source, String target, FilterChain filterChain);

##

##