@Test(expected = NullPointerException.class) public void addFile_NULL_STREAM() throws IOException { contentFileOperationPerformer.addFile(context, null, "file.txt"); }
public void addFile(ContentFileTransactionContext context, InputStream inputStream, String path) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(path); File contentDirectory = context.getContentDirectory(); FileUtils.copyInputStreamToFile(inputStream, new File(contentDirectory, path)); context.addAddedFile(path); }
ContentFileOperationPerformer { public void addFile(ContentFileTransactionContext context, InputStream inputStream, String path) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(path); File contentDirectory = context.getContentDirectory(); FileUtils.copyInputStreamToFile(inputStream, new File(contentDirectory, path)); context.addAddedFile(path); } }
ContentFileOperationPerformer { public void addFile(ContentFileTransactionContext context, InputStream inputStream, String path) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(path); File contentDirectory = context.getContentDirectory(); FileUtils.copyInputStreamToFile(inputStream, new File(contentDirectory, path)); context.addAddedFile(path); }  }
ContentFileOperationPerformer { public void addFile(ContentFileTransactionContext context, InputStream inputStream, String path) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(path); File contentDirectory = context.getContentDirectory(); FileUtils.copyInputStreamToFile(inputStream, new File(contentDirectory, path)); context.addAddedFile(path); }  void addFile(ContentFileTransactionContext context, InputStream inputStream, String path); void overwriteFile(ContentFileTransactionContext context, InputStream inputStream, String path, String oldPath); }
ContentFileOperationPerformer { public void addFile(ContentFileTransactionContext context, InputStream inputStream, String path) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkNotNull(inputStream); Preconditions.checkNotNull(path); File contentDirectory = context.getContentDirectory(); FileUtils.copyInputStreamToFile(inputStream, new File(contentDirectory, path)); context.addAddedFile(path); }  void addFile(ContentFileTransactionContext context, InputStream inputStream, String path); void overwriteFile(ContentFileTransactionContext context, InputStream inputStream, String path, String oldPath);  }