Created
October 27, 2010 17:59
-
-
Save jfarcand/649583 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testPutLargeFile() | |
throws Exception | |
{ | |
File file = new File( "/workspace/patch.txt" ); | |
FileInputStream input = new FileInputStream(file); | |
Realm realm = new Realm.RealmBuilder().setPrincipal( "xxx" ).setPassword( "xxx" ).build(); | |
ProxyServer proxyServer = new ProxyServer(ProxyServer.Protocol.HTTP, "192.168.2.106", 3128); | |
AsyncHttpClientConfig config = | |
new AsyncHttpClientConfig.Builder().setRealm( realm ).setProxyServer(proxyServer).setCompressionEnabled( false ).build(); | |
AsyncHttpClient client = new AsyncHttpClient( config ); | |
System.out.println( "START: " + System.currentTimeMillis() ); | |
Future<?> future = | |
client.preparePut( "https://repository.sonatype.org/service/local/staging/deploy/maven2" ) | |
.setProxyServer(proxyServer).setBody( input ).execute( new TestHandler() ); | |
System.out.println( "DONE: " + System.currentTimeMillis() + ", " + future.get() ); | |
client.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment