Skip to end of metadata
Go to start of metadata


 

Transfer Polling

You can use the Java API Client's method requestActiveTransfers() to obtain a list of all active transfers that have been sent to the client's email address. The client has to be verified for this method to succeed. The method will return a map, with the transfer meta IDs as keys, and the corresponding download urls (without the password) as values. A download url will have the format "https://cryptshare.server.com/download1.php?id=33d03d8d6b", where the id parameter is the transfer meta id.

Example: Request active transfers
// First create the Client instance
// Create a WebServiceUri for your Cryptshare Server 
WebServiceUri serviceUri = new WebServiceUri("https://cryptshare.server.com");
  
// Create a CryptshareConnection instance for your WebServiceUri
CryptshareConnection connection = new CryptshareConnection(serviceUri);
  
// Create the Client instance with the email address of the recipient, for which you want to get the transfers, 
// the CryptshareConnection, and the path to the verification store.
Client client = new Client("John.Doe@server.com", connection, "C:\temp");

// Request the active transfers for this client
// Returns a Map containing all transfer ids and download urls for all active transfers that were sent to this client's 
// email address (in this example: "John.Doe@server.com"). 
// This method will throw an exception if the client/email address has not been verified.
Map<String, String> transferIdMap = client.requestActiveTransfers();

for (Entry<String, String> entry : transferIdMap.entrySet()) {
    System.out.println("Entry in transfer id map: metaId = " + entry.getKey() + " url = " + entry.getValue());
}

 


  • No labels