You can do something similar as below
String req = "http://sp2k13/sites/ifsp/_api/Web/Folders/add('LibraryName/FolderName')"
NTCredentials credentials = new NTCredentials(UserName, Password, "JAVA-MACHINE-NAME", "DOMAIN");
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, credentials);
httpClient.getParams().setAuthenticationPreemptive(true);
ClientExecutor clientExecutor = new ApacheHttpClientExecutor(httpClient);
java.net.URI uri = new java.net.URI(req);
ClientRequestFactory fac = new ClientRequestFactory(clientExecutor, uri);
ClientRequest request = fac.createRequest(req);
request.header("content-type", "application/json;odata=verbose");
request.header("X-RequestDigest", digestValue);
request.accept("application/json;odata=verbose");
ClientResponse<String> response = request.post(String.class);
if (response.getStatus() != 200) {
throw new RuntimeException("Failed : HTTP error code : " +
response.getStatus());
}
For more information go through article http://blog.ctp.com/2012/12/21/interoperability-between-java-and-sharepoint-2013-on-premises/