Obtain information about the document format before opening it to avoid an exception if you are not sure what the actual content of the file is using Java....GetFiles method of the Directory class (from the System.IO namespace)...the Move method of the File class, from the same System.IO namespace...