public class ShareFileUtils
extends java.lang.Object
Constructor and Description |
---|
ShareFileUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
closeSession(java.lang.String subdomain,
java.lang.String sfdomain,
com.citrix.sharefile.api.authentication.SFOAuth2Token token)
Util for closing the sharefile session over REST
|
static com.citrix.sharefile.api.models.SFFolder |
createFolder(com.citrix.sharefile.api.interfaces.ISFApiClient apiClient,
java.lang.String folderName)
Create the specified folder on the root directory of this user
|
static com.google.gson.JsonObject |
createShare(java.lang.String subdomain,
java.lang.String sfdomain,
com.citrix.sharefile.api.interfaces.ISFApiClient apiClient,
com.citrix.sharefile.api.authentication.SFOAuth2Token token,
com.citrix.sharefile.api.models.SFFolder parentFolder,
Email email)
Wrapper for creating a Share link with an expiration date
|
static java.lang.String |
getAttachmentFilename(java.lang.String ticket,
Email email,
java.lang.String documentId)
returns the filename for the email attachment with the passed in documentId, taking into account that
the attachment filename may be stored on the email if the attachment has no content (aka is an extra attachment)
|
static com.citrix.sharefile.api.models.SFFolder |
getParentFolder(com.citrix.sharefile.api.interfaces.ISFApiClient apiClient) |
static void |
uploadFile(java.lang.String ticket,
ShareFileConfig config,
com.citrix.sharefile.api.authentication.SFOAuth2Token token,
java.lang.String parentId,
java.lang.String objectId,
java.io.InputStream inputStream,
java.lang.String filename)
Uploads a File using the Standard upload method with a multipart/form mime encoded POST.
|
public static com.citrix.sharefile.api.models.SFFolder getParentFolder(com.citrix.sharefile.api.interfaces.ISFApiClient apiClient) throws com.citrix.sharefile.api.exceptions.SFInvalidStateException, com.citrix.sharefile.api.exceptions.SFServerException, com.citrix.sharefile.api.exceptions.SFNotAuthorizedException, com.citrix.sharefile.api.exceptions.SFOAuthTokenRenewException, com.citrix.sharefile.api.exceptions.SFOtherException
com.citrix.sharefile.api.exceptions.SFInvalidStateException
com.citrix.sharefile.api.exceptions.SFServerException
com.citrix.sharefile.api.exceptions.SFNotAuthorizedException
com.citrix.sharefile.api.exceptions.SFOAuthTokenRenewException
com.citrix.sharefile.api.exceptions.SFOtherException
public static com.citrix.sharefile.api.models.SFFolder createFolder(com.citrix.sharefile.api.interfaces.ISFApiClient apiClient, java.lang.String folderName)
apiClient
- folderName
- public static com.google.gson.JsonObject createShare(java.lang.String subdomain, java.lang.String sfdomain, com.citrix.sharefile.api.interfaces.ISFApiClient apiClient, com.citrix.sharefile.api.authentication.SFOAuth2Token token, com.citrix.sharefile.api.models.SFFolder parentFolder, Email email) throws java.lang.Exception
subdomain
- - i.e. tsgrpsfdomain
- - i.e. sharefile.comtoken
- - valid Sharefile OAuth tokenparentFolder
- recipients
- - list of email addressesjava.lang.Exception
public static boolean closeSession(java.lang.String subdomain, java.lang.String sfdomain, com.citrix.sharefile.api.authentication.SFOAuth2Token token) throws java.lang.Exception
subdomain
- - i.e. tsgrpsfdomain
- - i.e. sharefile.comtoken
- - the OAuth2Token returned from authenticatejava.lang.Exception
public static void uploadFile(java.lang.String ticket, ShareFileConfig config, com.citrix.sharefile.api.authentication.SFOAuth2Token token, java.lang.String parentId, java.lang.String objectId, java.io.InputStream inputStream, java.lang.String filename) throws java.io.IOException, org.apache.http.ParseException
token
- - the OAuth2Token returned from authenticateparentId
- - where to upload the FilelocalPath
- - the path of the file to upload, like "c:\\path\\to\\file.name"java.text.ParseException
java.io.IOException
org.apache.http.ParseException
public static java.lang.String getAttachmentFilename(java.lang.String ticket, Email email, java.lang.String documentId)
ticket
- email
- - the email that the document is attached todocumentId
- - Id of the document we want to return the name for