See the Java API tutorial, in the 'Copying FileDocuments' example an Entity named 'Attachment' is created.