Skip to content

Commit

Permalink
Support files larger then 2GB (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhan1 authored Aug 22, 2024
1 parent e790442 commit 986f2f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

import static com.redhat.red.build.koji.model.json.KojiJsonConstants.ARCH;
Expand Down Expand Up @@ -59,7 +60,7 @@ public class BuildOutput

@JsonProperty(FILESIZE)
@DataKey( FILESIZE )
private int fileSize;
private long fileSize;

@JsonProperty(ARCH)
@DataKey( ARCH )
Expand Down Expand Up @@ -110,7 +111,7 @@ public void setFilename( String filename )
this.filename = filename;
}

public void setFileSize( int fileSize )
public void setFileSize( long fileSize )
{
this.fileSize = fileSize;
}
Expand Down Expand Up @@ -150,7 +151,7 @@ public String getFilename()
return filename;
}

public int getFileSize()
public long getFileSize()
{
return fileSize;
}
Expand Down Expand Up @@ -215,7 +216,7 @@ public Builder withChecksum( String type, String checksum )
return this;
}

public Builder withFileSize( int size )
public Builder withFileSize( long size )
{
target.fileSize = size;

Expand Down Expand Up @@ -389,15 +390,7 @@ public boolean equals( Object o )
@Override
public int hashCode()
{
int result = getBuildrootId();
result = 31 * result + ( getFilename() != null ? getFilename().hashCode() : 0 );
result = 31 * result + ( getFileSize() ^ ( getFileSize() >>> 32 ) );
result = 31 * result + ( getArch() != null ? getArch().hashCode() : 0 );
result = 31 * result + ( getChecksumType() != null ? getChecksumType().hashCode() : 0 );
result = 31 * result + ( getChecksum() != null ? getChecksum().hashCode() : 0 );
result = 31 * result + ( getOutputType() != null ? getOutputType().hashCode() : 0 );
result = 31 * result + ( getExtraInfo() != null ? getExtraInfo().hashCode() : 0 );
return result;
return Objects.hash(buildrootId, filename, fileSize, arch, checksumType, checksum, outputType, extraInfo);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/messages/struct-KojiImport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<member>
<name>filesize</name>
<value>
<int>193</int>
<i8>193</i8>
</value>
</member>
<member>
Expand Down

0 comments on commit 986f2f4

Please sign in to comment.