public class GDriveCrypter extends GDriver
String fileNameToUpload = "someFile.txt"; GDriveCrypter instance = new GDriveCrypter(fileNameToUpload); //Authorize GDrive instance.initDrive(instance.authorize()); // Encrypt String encryptedFilename = instance.encrypt(instance.getloadFilePath()); if (encryptedFilename!=null && !encryptedFilename.equals("")) { // Send File to GDrive instance.setloadFilePath(encryptedFilename); File uploadedFile = instance.uploadFile(false); }
Modifier and Type | Field and Description |
---|---|
private static String |
CLASSNAME
A holder This classes name (used when logging).
|
protected static String |
ECRYPT_FILEMARKER
The Extension to use on the filename to markk it as AESEncrypted.
|
private String |
eCryptPass
Password for the AES Encryption
|
APPLICATION_NAME, CLASSPATH, clientSecrets_, dataStoreDir_, dataStoreFactory_, DEFAULT_DATASTORE_DIR, DEFAULT_DOWNLOAD_DIR, DEFAULT_LOAD_FILENAME, dirForDownload_, drive_, httpTransport_, jsonFactory_, loadFile_, loadFilePath_, SYSTEM_FILE_SEPERATOR, SYSTEM_LINE_SEPERATOR, USERDIR, USERHOME
Constructor and Description |
---|
GDriveCrypter()
Default constructor that gets all the basic class settimgs setup and gives you a class instance to do the work.
|
GDriveCrypter(String filenameToLoad)
Constructor that gets all the basic class settimgs setup, setsup the filename to upload and gives you a class instance to do the work.
|
Modifier and Type | Method and Description |
---|---|
String |
decrypt(String filename) |
String |
decrypt(String pass,
String filename) |
String |
encrypt(String filename) |
String |
encrypt(String pass,
String filename) |
private String |
geteCryptPass()
get the eCryptPass password used for encryption.
|
static void |
main(String[] args) |
private void |
seteCryptPass(String pass)
set the eCryptPass password used for encryption.
|
authorize, bzip2It, ensureFolderExists, getloadFilePath, initDrive, initSecrets, setloadFilePath, unBzip2It, uploadFile
protected static final String ECRYPT_FILEMARKER
private String eCryptPass
public GDriveCrypter() throws GeneralSecurityException, IOException
GDriveCrypter instance = new GDriveCrypter(); // uses the DEFAULT_LOAD_FILENAME //Authorize GDrive instance.initDrive(instance.authorize()); // Encrypt String encryptedFilename = instance.encrypt(instance.getloadFilePath()); if (encryptedFilename!=null && !encryptedFilename.equals("")) { // Send File to GDrive instance.setloadFilePath(encryptedFilename); File uploadedFile = instance.uploadFile(false); }
GeneralSecurityException
IOException
public GDriveCrypter(String filenameToLoad) throws GeneralSecurityException, IOException
String fileNameToUpload = "someFile.txt"; GDriveCrypter instance = new GDriveCrypter(fileNameToUpload); //Authorize GDrive instance.initDrive(instance.authorize()); // Encrypt String encryptedFilename = instance.encrypt(instance.getloadFilePath()); if (encryptedFilename!=null && !encryptedFilename.equals("")) { // Send File to GDrive instance.setloadFilePath(encryptedFilename); File uploadedFile = instance.uploadFile(false); }
GeneralSecurityException
IOException
private void seteCryptPass(String pass)
private String geteCryptPass()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses