maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Silvio Assuncao (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WAGON-485) Integer Filesize
Date Mon, 09 Jan 2017 19:13:58 GMT

     [ https://issues.apache.org/jira/browse/WAGON-485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Silvio Assuncao updated WAGON-485:
----------------------------------
    Description: 
ScpWagon class parse a String value to Integer (Filesize) but if you have a large file (3.6GB)
the file size is 3865470566 in bytes, the number is more than the MAX_VALUE of Integer.
{code:title=ScpWagon.java|borderStyle=solid}
public void fillInputData( InputData inputData )
        throws TransferFailedException, ResourceDoesNotExistException {
...
int filesize = Integer.valueOf( line.substring( 5, index ) ).intValue();
fireTransferDebug( "Remote file size: " + filesize );

resource.setContentLength( filesize );
...
{code}

I changed the line to parse using Long, because the `resource.setContentLength` receive a
long value too

{code:title=ScpWagon.java|borderStyle=solid}
long filesize = Long.valueOf( line.substring( 5, index ) );
{code}

Please check the pull-request https://github.com/apache/maven-wagon/pull/32



  was:
ScpWagon class parse a String value to Integer (Filesize) but if you have a large file (3.6GB)
the file size is 3865470566 in bytes, the number is more than the MAX_VALUE of Integer.
{code:title=ScpWagon.java|borderStyle=solid}
public void fillInputData( InputData inputData )
        throws TransferFailedException, ResourceDoesNotExistException {
...
int filesize = Integer.valueOf( line.substring( 5, index ) ).intValue();
fireTransferDebug( "Remote file size: " + filesize );

resource.setContentLength( filesize );
...
{code}

Changed to parse using Long, because the `resource.setContentLength` receive a long value
too

{code:title=ScpWagon.java|borderStyle=solid}
long filesize = Long.valueOf( line.substring( 5, index ) );
{code}

Please check the pull-request https://github.com/apache/maven-wagon/pull/32




> Integer Filesize
> ----------------
>
>                 Key: WAGON-485
>                 URL: https://issues.apache.org/jira/browse/WAGON-485
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ssh
>    Affects Versions: 2.10
>            Reporter: Silvio Assuncao
>            Priority: Critical
>
> ScpWagon class parse a String value to Integer (Filesize) but if you have a large file
(3.6GB) the file size is 3865470566 in bytes, the number is more than the MAX_VALUE of Integer.
> {code:title=ScpWagon.java|borderStyle=solid}
> public void fillInputData( InputData inputData )
>         throws TransferFailedException, ResourceDoesNotExistException {
> ...
> int filesize = Integer.valueOf( line.substring( 5, index ) ).intValue();
> fireTransferDebug( "Remote file size: " + filesize );
> resource.setContentLength( filesize );
> ...
> {code}
> I changed the line to parse using Long, because the `resource.setContentLength` receive
a long value too
> {code:title=ScpWagon.java|borderStyle=solid}
> long filesize = Long.valueOf( line.substring( 5, index ) );
> {code}
> Please check the pull-request https://github.com/apache/maven-wagon/pull/32



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message