public long getContentLength() { return resource.getContentLength(); }
public String getName() { String name = resource.getName(); if ( name == null ) { name = ""; } else if ( name.startsWith( "/" ) ) { name = name.substring( 1 ); } return name; }
public void putFromStream( InputStream stream, String destination, long contentLength, long lastModified ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, null ); resource.setContentLength( contentLength ); resource.setLastModified( lastModified ); putFromStream( stream, resource ); }
public static Resource getResource( String resourceName ) { String r = StringUtils.replace( resourceName, "\\", "/" ); return new Resource( r ); }
public void putFromStream( final InputStream stream, String destination, long contentLength, long lastModified ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, null ); resource.setContentLength( contentLength ); resource.setLastModified( lastModified ); put( stream, resource, null ); }
public static Resource getResource( String resourceName ) { String r = StringUtils.replace( resourceName, "\\", "/" ); return new Resource( r ); }
private RequestEntityImplementation( final InputStream stream, final Resource resource, final Wagon wagon, final File source ) throws TransferFailedException { if ( source != null ) { this.source = source; this.repeatable = true; } else { this.stream = stream; this.repeatable = false; } this.resource = resource; this.length = resource == null ? -1 : resource.getContentLength(); this.wagon = wagon; }
public void putFromStream( InputStream stream, String destination, long contentLength, long lastModified ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, null ); resource.setContentLength( contentLength ); resource.setLastModified( lastModified ); putFromStream( stream, resource ); }
@Override protected void putFromStream( InputStream stream, Resource resource ) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException { putFromStream( stream, resource.getName(), -1, -1 ); }
public void putFromStream( InputStream stream, String destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, null ); putFromStream( stream, resource ); }
private RequestEntityImplementation( final InputStream stream, final Resource resource, final Wagon wagon, final File source ) throws TransferFailedException { if ( source != null ) { this.source = source; this.repeatable = true; } else { this.stream = stream; this.repeatable = false; } this.resource = resource; this.length = resource == null ? -1 : resource.getContentLength(); this.wagon = wagon; }
public void putFromStream( final InputStream stream, String destination, long contentLength, long lastModified ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, null ); resource.setContentLength( contentLength ); resource.setLastModified( lastModified ); put( stream, resource, null ); }
@Override protected void putFromStream( InputStream stream, Resource resource ) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException { putFromStream( stream, resource.getName(), -1, -1 ); }
public void putFromStream( InputStream stream, String destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( destination ); firePutInitiated( resource, null ); putFromStream( stream, resource ); }
public void testWagonGetIfNewerIsSame() throws Exception { if ( supportsGetIfNewer() ) { setupRepositories(); setupWagonTestingFixtures(); int expectedSize = putFile(); getIfNewer( getExpectedLastModifiedOnGet( testRepository, new Resource( resource ) ), false, expectedSize ); } }
public void testWagonGetIfNewerToStreamIsSame() throws Exception { if ( supportsGetIfNewer() ) { setupRepositories(); setupWagonTestingFixtures(); int expectedSize = putFile(); getIfNewerToStream( getExpectedLastModifiedOnGet( testRepository, new Resource( resource ) ), false, expectedSize ); } }
public void testWagonGetIfNewerIsSame() throws Exception { if ( supportsGetIfNewer() ) { setupRepositories(); setupWagonTestingFixtures(); int expectedSize = putFile(); getIfNewer( getExpectedLastModifiedOnGet( testRepository, new Resource( resource ) ), false, expectedSize ); } }
public void testWagonGetIfNewerToStreamIsSame() throws Exception { if ( supportsGetIfNewer() ) { setupRepositories(); setupWagonTestingFixtures(); int expectedSize = putFile(); getIfNewerToStream( getExpectedLastModifiedOnGet( testRepository, new Resource( resource ) ), false, expectedSize ); } }