< resNode.setProperty("jcr:data", new FileInputStream(file));>I think, the problem lies here in the importFile() method: Try out this one: resNode.setProperty(JcrConstants.JCR_DATA, resNode.getSession().getValueFactory().createBinary(input)); important: "input" is an InputStream to the file, you want to import
