public class BindUploader extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
static int |
arrayBindValueCount(Map<String,ParameterBindingDTO> bindValues)
Compute the number of array bind values in the given bind map
|
void |
close()
Close uploader, deleting the local temporary directory
|
Path |
getBindDir()
Return the local path to which binds are serialized
|
String |
getStagePath()
Return the stage path to which binds are uploaded
|
static boolean |
isArrayBind(Map<String,ParameterBindingDTO> bindValues)
Return whether the bind map uses array binds
|
static BindUploader |
newInstance(SFSession session,
String stageDir)
Create a new BindUploader which will upload to the given stage path Ensure temporary directory
for file writing exists
|
void |
setFileSize(int fileSize)
Set the approximate maximum size in bytes for a single bind file
|
void |
upload(Map<String,ParameterBindingDTO> bindValues)
Upload the bindValues to stage
|
public static BindUploader newInstance(SFSession session, String stageDir) throws BindException
session - the session to use for uploading bindsstageDir - the stage path to upload toBindException - if temporary directory could not be createdpublic void upload(Map<String,ParameterBindingDTO> bindValues) throws BindException
bindValues - the bind map to uploadBindException - if the bind map could not be serialized or upload failspublic void close()
This class can be used in a try-with-resources statement, which ensures that the temporary directory is cleaned up even when exceptions occur
close in interface Closeableclose in interface AutoCloseablepublic void setFileSize(int fileSize)
fileSize - size in bytespublic String getStagePath()
public Path getBindDir()
public static int arrayBindValueCount(Map<String,ParameterBindingDTO> bindValues)
bindValues - the bind mappublic static boolean isArrayBind(Map<String,ParameterBindingDTO> bindValues)
bindValues - the bind mapCopyright © 2020. All rights reserved.