Take a look at JCA, and look around for a good JCA adapter that provides file i/o. if you're working in a Java EE app, you probably want the transactional advantages that a properly implemented JCA adapter can/should provide (ACID, rollback, etc.) also, using a resource exposed by the container rather than "going native" will allow deployment security to operate properly wrt touching resources outside the container (files, sockets, etc.).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…