// Path: dsm-webapi-client-filestation/src/main/java/com/github/gauthierj/dsm/webapi/client/filestation/common/File.java
// public class File {
// 
//     private final String path;
//     private final String name;
//     private final boolean directory;
//     private final FileProperties properties;
//     private final List<File> children = new ArrayList<>();
// 
//     @JsonCreator
//     public File(
//             @JsonProperty("path") String path,
//             @JsonProperty("name") String name,
//             @JsonProperty("isdir") boolean directory,
//             @JsonProperty("additional") FileProperties properties,
//             @JsonProperty("children") FileList children) {
//         this.path = path;
//         this.name = name;
//         this.directory = directory;
//         this.properties = properties;
//         if(children != null) {
//             this.children.addAll(children.getElements());
//         }
//     }
// 
//     public String getPath() {
//         return path;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public boolean isDirectory() {
//         return directory;
//     }
// 
//     public FileProperties getProperties() {
//         return properties;
//     }
// 
//     public List<File> getChildren() {
//         return Collections.unmodifiableList(children);
//     }
// 
//     public static class FileList extends PaginatedList<File> {
// 
//         public FileList(@JsonProperty("total") int total,
//                         @JsonProperty("offset") int offset,
//                         @JsonProperty("files") List<File> files) {
//             super(total, offset, files);
//         }
//     }
// }
// 
// Path: dsm-webapi-client-integration-tests/src/test/java/com/github/gauthierj/dsm/webapi/client/AbstractTest.java
// @RunWith(SpringJUnit4ClassRunner.class)
// @ContextConfiguration(classes = TestConfiguration.class)
// @TestPropertySource("classpath:application-test.properties")
// @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
// public abstract class AbstractTest {
// 
//     private static final String FILE_RESOURCES_ROOT = "/file-resources";
// 
//     @Value("${dsm.share}")
//     private String share;
// 
//     @Value("${dsm.share.mountPoint}")
//     private String shareMountPointPath;
// 
//     private Path shareMountPoint;
// 
//     @Before
//     public void setUp() throws URISyntaxException, IOException, InterruptedException {
//         shareMountPoint = Paths.get(shareMountPointPath);
//         Assert.assertTrue(Files.exists(shareMountPoint));
//         Assert.assertTrue(Files.isWritable(shareMountPoint));
//         createFileStructure();
//     }
// 
//     @After
//     public void tearDown() throws IOException {
//         FileUtils.cleanDirectory(shareMountPoint.toFile());
//     }
// 
//     public String getShare() {
//         return share;
//     }
// 
//     public String getShareRoot() {
//         return "/" + share;
//     }
// 
//     public Path getShareMountPoint() {
//         return shareMountPoint;
//     }
// 
//     private void createFileStructure() throws URISyntaxException, IOException, InterruptedException {
//         URL resource = AbstractTest.class.getResource(FILE_RESOURCES_ROOT);
//         Path fileResourcesRoot = Paths.get(resource.toURI());
//         int i = 0;
//         while (i < 5) {
//             try {
//                 FileUtils.copyDirectory(fileResourcesRoot.toFile(), shareMountPoint.toFile());
//                 i = 5;
//             } catch (IOException e) {
//                 if (i < 4) {
//                     Thread.sleep(1000 + i * i * 1000);
//                     i++;
//                 } else {
//                     throw new IllegalStateException("Could not create file structure", e);
//                 }
//             }
//         }
//     }
// 
// }
// 
// Path: dsm-webapi-client-filestation/src/main/java/com/github/gauthierj/dsm/webapi/client/filestation/exception/FileNotFoundException.java
// public class FileNotFoundException extends DsmWebApiErrorException {
// 
//     private final String path;
// 
//     public FileNotFoundException(String path, DsmWebApiResponseError error) {
//         super("No such file or directory", error);
//         this.path = path;
//     }
// 
//     public FileNotFoundException(Throwable cause, String path) {
//         super("No such file or directory", cause, null);
//         this.path = path;
//     }
// 
//     public String getPath() {
//         return path;
//     }
// }


import com.github.gauthierj.dsm.webapi.client.filestation.common.File;
import com.github.gauthierj.dsm.webapi.client.AbstractTest;
import com.github.gauthierj.dsm.webapi.client.filestation.exception.FileNotFoundException;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Arrays;
import java.util.List;
package com.github.gauthierj.dsm.webapi.client.filestation.filelist;



public class FileListServiceTest extends AbstractTest{

    @Autowired
    FileListService fileListService;

    @Test
    public void testList() throws Exception {
        List<File> list = fileListService.list("/dsm-webapi-it");
        Assert.assertEquals(3, list.size());
    }

    @Test
    public void testGetFiles() {
// Path: dsm-webapi-client-filestation/src/main/java/com/github/gauthierj/dsm/webapi/client/filestation/common/File.java
// public class File {
// 
//     private final String path;
//     private final String name;
//     private final boolean directory;
//     private final FileProperties properties;
//     private final List<File> children = new ArrayList<>();
// 
//     @JsonCreator
//     public File(
//             @JsonProperty("path") String path,
//             @JsonProperty("name") String name,
//             @JsonProperty("isdir") boolean directory,
//             @JsonProperty("additional") FileProperties properties,
//             @JsonProperty("children") FileList children) {
//         this.path = path;
//         this.name = name;
//         this.directory = directory;
//         this.properties = properties;
//         if(children != null) {
//             this.children.addAll(children.getElements());
//         }
//     }
// 
//     public String getPath() {
//         return path;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public boolean isDirectory() {
//         return directory;
//     }
// 
//     public FileProperties getProperties() {
//         return properties;
//     }
// 
//     public List<File> getChildren() {
//         return Collections.unmodifiableList(children);
//     }
// 
//     public static class FileList extends PaginatedList<File> {
// 
//         public FileList(@JsonProperty("total") int total,
//                         @JsonProperty("offset") int offset,
//                         @JsonProperty("files") List<File> files) {
//             super(total, offset, files);
//         }
//     }
// }
// 
// Path: dsm-webapi-client-integration-tests/src/test/java/com/github/gauthierj/dsm/webapi/client/AbstractTest.java
// @RunWith(SpringJUnit4ClassRunner.class)
// @ContextConfiguration(classes = TestConfiguration.class)
// @TestPropertySource("classpath:application-test.properties")
// @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
// public abstract class AbstractTest {
// 
//     private static final String FILE_RESOURCES_ROOT = "/file-resources";
// 
//     @Value("${dsm.share}")
//     private String share;
// 
//     @Value("${dsm.share.mountPoint}")
//     private String shareMountPointPath;
// 
//     private Path shareMountPoint;
// 
//     @Before
//     public void setUp() throws URISyntaxException, IOException, InterruptedException {
//         shareMountPoint = Paths.get(shareMountPointPath);
//         Assert.assertTrue(Files.exists(shareMountPoint));
//         Assert.assertTrue(Files.isWritable(shareMountPoint));
//         createFileStructure();
//     }
// 
//     @After
//     public void tearDown() throws IOException {
//         FileUtils.cleanDirectory(shareMountPoint.toFile());
//     }
// 
//     public String getShare() {
//         return share;
//     }
// 
//     public String getShareRoot() {
//         return "/" + share;
//     }
// 
//     public Path getShareMountPoint() {
//         return shareMountPoint;
//     }
// 
//     private void createFileStructure() throws URISyntaxException, IOException, InterruptedException {
//         URL resource = AbstractTest.class.getResource(FILE_RESOURCES_ROOT);
//         Path fileResourcesRoot = Paths.get(resource.toURI());
//         int i = 0;
//         while (i < 5) {
//             try {
//                 FileUtils.copyDirectory(fileResourcesRoot.toFile(), shareMountPoint.toFile());
//                 i = 5;
//             } catch (IOException e) {
//                 if (i < 4) {
//                     Thread.sleep(1000 + i * i * 1000);
//                     i++;
//                 } else {
//                     throw new IllegalStateException("Could not create file structure", e);
//                 }
//             }
//         }
//     }
// 
// }
// 
// Path: dsm-webapi-client-filestation/src/main/java/com/github/gauthierj/dsm/webapi/client/filestation/exception/FileNotFoundException.java
// public class FileNotFoundException extends DsmWebApiErrorException {
// 
//     private final String path;
// 
//     public FileNotFoundException(String path, DsmWebApiResponseError error) {
//         super("No such file or directory", error);
//         this.path = path;
//     }
// 
//     public FileNotFoundException(Throwable cause, String path) {
//         super("No such file or directory", cause, null);
//         this.path = path;
//     }
// 
//     public String getPath() {
//         return path;
//     }
// }


// Path: dsm-webapi-client-integration-tests/src/test/java/com/github/gauthierj/dsm/webapi/client/filestation/filelist/FileListServiceTest.java
import com.github.gauthierj.dsm.webapi.client.filestation.common.File;
import com.github.gauthierj.dsm.webapi.client.AbstractTest;
import com.github.gauthierj.dsm.webapi.client.filestation.exception.FileNotFoundException;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Arrays;
import java.util.List;

package com.github.gauthierj.dsm.webapi.client.filestation.filelist;



public class FileListServiceTest extends AbstractTest{

    @Autowired
    FileListService fileListService;

    @Test
    public void testList() throws Exception {
        List<File> list = fileListService.list("/dsm-webapi-it");
        Assert.assertEquals(3, list.size());
    }

    @Test
    public void testGetFiles() {
        List<File> files = fileListService.getFiles(Arrays.asList("/dsm-webapi-it/test-1", "/dsm-webapi-it/test-text-file.txt"));