@Test
 public void downloadAFileInFolder()
     throws FileNotFoundException, IOException, ResourcesException {
   String resourceId = "Custom____CustomSimple.docx";
   JAXWSResourcesService client = JAXWSResourcesServiceClientFactory.create(BASE_ADDRESS);
   BinaryData document = client.download(resourceId);
   Assert.assertNotNull(document);
   Assert.assertNotNull(document.getContent());
   createFile(document.getContent(), resourceId);
 }
  @Test
  public void uploadARootFile() throws FileNotFoundException, IOException, ResourcesException {
    String resourceId = "ZzzNewSimple_" + this.getClass().getSimpleName() + ".docx";
    JAXWSResourcesService client = JAXWSResourcesServiceClientFactory.create(BASE_ADDRESS);
    InputStream document = Data.class.getResourceAsStream("Simple.docx");

    BinaryData dataIn = new BinaryData();
    dataIn.setResourceId(resourceId);
    dataIn.setContent(IOUtils.toByteArray(document));
    client.upload(dataIn);

    // Test if file was uploaded in the target/resources folder
    Assert.assertTrue(new File(resourcesFolder, resourceId).exists());

    // Test if download with the resourceId returns a non null binary data.
    BinaryData downloadedDocument = client.download(resourceId);
    Assert.assertNotNull(downloadedDocument);
    Assert.assertNotNull(downloadedDocument.getContent());
  }