use of com.att.aro.core.packetanalysis.impl.VideoStreamConstructor in project VideoOptimzer by attdevsupport.
the class FileManagerTest method findFiles.
@Test
public void findFiles() throws Exception {
String[] foundFiles;
VideoStreamConstructor videoStreamConstructor = context.getBean(VideoStreamConstructor.class);
IFileManager filemanager = context.getBean(IFileManager.class);
File tempFolder = Files.createTempDir();
filemanager.createFile(tempFolder.toString(), "file1");
String pathName1 = filemanager.createFile(tempFolder.toString(), "file1").toString();
String pathName1exten = filemanager.createFile(tempFolder.toString(), "file1.xyz").toString();
byte[] content = "dummy data".getBytes();
videoStreamConstructor.savePayload(content, pathName1);
videoStreamConstructor.savePayload(content, pathName1exten);
foundFiles = fileManager.findFiles(tempFolder.toString(), ".xyz");
assertThat(foundFiles).hasSize(1);
assertThat(foundFiles).contains("file1.xyz");
foundFiles = fileManager.findFiles(tempFolder.toString(), "child.xyz");
assertThat(foundFiles).isEmpty();
foundFiles = fileManager.findFiles(tempFolder.toString(), ".sh");
assertThat(foundFiles).isEmpty();
filemanager.directoryDeleteInnerFiles(tempFolder.toString());
filemanager.deleteFile(tempFolder.toString());
}
Aggregations