@Test public void fileFactoryValidFile_doesntExist() { when(file.isFile()).thenReturn(Boolean.FALSE); when(file.exists()).thenReturn(Boolean.FALSE); FileOrDirectoryTaskOutput instance = FileOrDirectoryTaskOutput.file(file); assertNotNull(instance); }
public static FileOrDirectoryTaskOutput file(File file) { if (file == null || (file.exists() && !file.isFile())) { throw new IllegalArgumentException("A valid instance is expected (not null or existing file)."); } return new FileOrDirectoryTaskOutput(file); }
FileOrDirectoryTaskOutput extends AbstractTaskOutput implements SingleOrMultipleTaskOutput { public static FileOrDirectoryTaskOutput file(File file) { if (file == null || (file.exists() && !file.isFile())) { throw new IllegalArgumentException("A valid instance is expected (not null or existing file)."); } return new FileOrDirectoryTaskOutput(file); } }
FileOrDirectoryTaskOutput extends AbstractTaskOutput implements SingleOrMultipleTaskOutput { public static FileOrDirectoryTaskOutput file(File file) { if (file == null || (file.exists() && !file.isFile())) { throw new IllegalArgumentException("A valid instance is expected (not null or existing file)."); } return new FileOrDirectoryTaskOutput(file); } FileOrDirectoryTaskOutput(File file); }
FileOrDirectoryTaskOutput extends AbstractTaskOutput implements SingleOrMultipleTaskOutput { public static FileOrDirectoryTaskOutput file(File file) { if (file == null || (file.exists() && !file.isFile())) { throw new IllegalArgumentException("A valid instance is expected (not null or existing file)."); } return new FileOrDirectoryTaskOutput(file); } FileOrDirectoryTaskOutput(File file); @Override File getDestination(); @Override void accept(TaskOutputDispatcher writer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); static FileOrDirectoryTaskOutput file(File file); static FileOrDirectoryTaskOutput directory(File directory); }
FileOrDirectoryTaskOutput extends AbstractTaskOutput implements SingleOrMultipleTaskOutput { public static FileOrDirectoryTaskOutput file(File file) { if (file == null || (file.exists() && !file.isFile())) { throw new IllegalArgumentException("A valid instance is expected (not null or existing file)."); } return new FileOrDirectoryTaskOutput(file); } FileOrDirectoryTaskOutput(File file); @Override File getDestination(); @Override void accept(TaskOutputDispatcher writer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); static FileOrDirectoryTaskOutput file(File file); static FileOrDirectoryTaskOutput directory(File directory);  }