How do I get a FileObject for a File? Apache NetBeans Wiki Index/Apache NetBeans Developer FAQ FileUtil.toFileObject (FileUtil.normalizeFile(theFile)); See this page in GitHub.