Skip to content

Conversation

@ggershinsky
Copy link
Contributor

No description provided.

@ggershinsky
Copy link
Contributor Author

cc @huaxingao

@Deprecated
public AesGcmInputFile(InputFile sourceFile, byte[] dataKey, byte[] fileAADPrefix) {
this(sourceFile, dataKey, fileAADPrefix, null);
throw new IllegalArgumentException("Can't create AesGcmInputFile without file length");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a breaking change. Can we change to:

this(sourceFile, dataKey, fileAADPrefix, sourceFile.getLength();

and move

throw new IllegalArgumentException("Can't create AesGcmInputFile without file length");

to

public AesGcmInputFile(InputFile sourceFile, byte[] dataKey, byte[] fileAADPrefix, Long length)

?

@Override
public InputFile toInputFile() {
return new AesGcmInputFile(targetFile.toInputFile(), dataKey, fileAADPrefix);
throw new IllegalStateException("File length unknown, creating an AesGcmInputFile is not safe");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a breaking change. Can we keep the current behavior but deprecate it in 2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants