|  |  | @@ -119,11 +119,11 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  | 		 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		public void setPathWithoutVerify(String path) throws UnsupportedEncodingException, InvalidPathException |  |  |  | 		public void setPathWithoutVerify(String path) throws UnsupportedEncodingException, InvalidPathException | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "setPath: "+path); |  |  |  | 			//Log.d(TAG, "setPath: "+path); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			mAccount = extractAccount(path); |  |  |  | 			mAccount = extractAccount(path); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			mAccountLocalPath = path.substring(getProtocolPrefix().length()+encode(mAccount).length()+1); |  |  |  | 			mAccountLocalPath = path.substring(getProtocolPrefix().length()+encode(mAccount).length()+1); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "  mAccount=" + mAccount); |  |  |  | 			//Log.d(TAG, "  mAccount=" + mAccount); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "  mAccountLocalPath=" + mAccountLocalPath); |  |  |  | 			//Log.d(TAG, "  mAccountLocalPath=" + mAccountLocalPath); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  | 		 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		public GDrivePath(String parentPath, File fileToAppend) throws UnsupportedEncodingException, FileNotFoundException, IOException, InvalidPathException |  |  |  | 		public GDrivePath(String parentPath, File fileToAppend) throws UnsupportedEncodingException, FileNotFoundException, IOException, InvalidPathException | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -166,13 +166,13 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			for (int i=0;i<parts.length;i++) |  |  |  | 			for (int i=0;i<parts.length;i++) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String part = parts[i]; |  |  |  | 				String part = parts[i]; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Log.d(TAG, "parsing part " + part); |  |  |  | 				//Log.d(TAG, "parsing part " + part); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 				int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP); |  |  |  | 				int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (indexOfSeparator < 0) |  |  |  | 				if (indexOfSeparator < 0) | 
			
		
	
		
		
			
				
					
					|  |  |  | 					throw new FileNotFoundException("invalid path " + mAccountLocalPath); |  |  |  | 					throw new FileNotFoundException("invalid path " + mAccountLocalPath); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String id = part.substring(indexOfSeparator+NAME_ID_SEP.length()); |  |  |  | 				String id = part.substring(indexOfSeparator+NAME_ID_SEP.length()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String name = decode(part.substring(0, indexOfSeparator)); |  |  |  | 				String name = decode(part.substring(0, indexOfSeparator)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Log.d(TAG, "   name=" + name); |  |  |  | 				//Log.d(TAG, "   name=" + name); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 				FileSystemEntryData thisFolder = accountData.mFolderCache.get(id); |  |  |  | 				FileSystemEntryData thisFolder = accountData.mFolderCache.get(id); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (thisFolder == null) |  |  |  | 				if (thisFolder == null) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				{ | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -220,7 +220,7 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			for (int i=0;i<parts.length;i++) |  |  |  | 			for (int i=0;i<parts.length;i++) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			{ |  |  |  | 			{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String part = parts[i]; |  |  |  | 				String part = parts[i]; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				Log.d(TAG, "parsing part " + part); |  |  |  | 				//Log.d(TAG, "parsing part " + part); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 				int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP); |  |  |  | 				int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (indexOfSeparator < 0) |  |  |  | 				if (indexOfSeparator < 0) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				{ | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -295,11 +295,11 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			thisFile.parentIds.add(parent.getId());				 |  |  |  | 			thisFile.parentIds.add(parent.getId());				 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		mAccountData.get(path.getAccount()).mFolderCache.put(thisFile.id, thisFile); |  |  |  | 		mAccountData.get(path.getAccount()).mFolderCache.put(thisFile.id, thisFile); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		try { |  |  |  | 		/*try { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "Added "+path.getFullPath()+" to cache"); |  |  |  | 			Log.d(TAG, "Added "+path.getFullPath()+" to cache"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} catch (UnsupportedEncodingException e) { |  |  |  | 		} catch (UnsupportedEncodingException e) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			e.printStackTrace(); |  |  |  | 			e.printStackTrace(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		}*/ | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		return thisFile; |  |  |  | 		return thisFile; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -336,14 +336,14 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private File getFileForPath(GDrivePath path, Drive driveService) |  |  |  | 	private File getFileForPath(GDrivePath path, Drive driveService) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			throws IOException, InvalidPathException { |  |  |  | 			throws IOException, InvalidPathException { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d(TAG,"getFileForPath... "); |  |  |  | 		//Log.d(TAG,"getFileForPath... "); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		try |  |  |  | 		try | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			//throw new IOException("argh"); |  |  |  | 			//throw new IOException("argh"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			String driveId = path.getGDriveId(); |  |  |  | 			String driveId = path.getGDriveId(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "id"+driveId); |  |  |  | 			//Log.d(TAG, "id"+driveId); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			File file = driveService.files().get(driveId).execute(); |  |  |  | 			File file = driveService.files().get(driveId).execute(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG,"...done."); |  |  |  | 			//Log.d(TAG,"...done."); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			return file; |  |  |  | 			return file; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		catch (IOException e) |  |  |  | 		catch (IOException e) | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -409,7 +409,7 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			File file = getDriveService(parentGdrivePath.getAccount()).files().insert(body).execute(); |  |  |  | 			File file = getDriveService(parentGdrivePath.getAccount()).files().insert(body).execute(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			 |  |  |  | 			 | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "created folder "+newDirName+" in "+parentPath+". id: "+file.getId()); |  |  |  | 			//Log.d(TAG, "created folder "+newDirName+" in "+parentPath+". id: "+file.getId()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			//add to cache to avoid network traffic if this folder is accessed (which is likely to happen soon) |  |  |  | 			//add to cache to avoid network traffic if this folder is accessed (which is likely to happen soon) | 
			
		
	
		
		
			
				
					
					|  |  |  | 			FileSystemEntryData newCacheEntry = new FileSystemEntryData(); |  |  |  | 			FileSystemEntryData newCacheEntry = new FileSystemEntryData(); | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -537,12 +537,12 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 |  |  |  | 		 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		try |  |  |  | 		try | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "getFileEntry "+filename); |  |  |  | 			//Log.d(TAG, "getFileEntry "+filename); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			GDrivePath gdrivePath = new GDrivePath(filename); |  |  |  | 			GDrivePath gdrivePath = new GDrivePath(filename); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			FileEntry res =  convertToFileEntry( |  |  |  | 			FileEntry res =  convertToFileEntry( | 
			
		
	
		
		
			
				
					
					|  |  |  | 					getFileForPath(gdrivePath, getDriveService(gdrivePath.getAccount())), |  |  |  | 					getFileForPath(gdrivePath, getDriveService(gdrivePath.getAccount())), | 
			
		
	
		
		
			
				
					
					|  |  |  | 					filename); |  |  |  | 					filename); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "getFileEntry res"+res); |  |  |  | 			//Log.d(TAG, "getFileEntry res"+res); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			return res; |  |  |  | 			return res; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		catch (Exception e) |  |  |  | 		catch (Exception e) | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -580,22 +580,22 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private Drive getDriveService(String accountName) |  |  |  | 	private Drive getDriveService(String accountName) | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d(TAG, "getDriveService "+accountName); |  |  |  | 		//Log.d(TAG, "getDriveService "+accountName); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		AccountData accountData = mAccountData.get(accountName); |  |  |  | 		AccountData accountData = mAccountData.get(accountName); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d(TAG, "accountData "+accountData); |  |  |  | 		//Log.d(TAG, "accountData "+accountData); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		return accountData.drive; |  |  |  | 		return accountData.drive; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	@Override |  |  |  | 	@Override | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public void onActivityResult(final JavaFileStorage.FileStorageSetupActivity setupAct, int requestCode, int resultCode, Intent data) { |  |  |  | 	public void onActivityResult(final JavaFileStorage.FileStorageSetupActivity setupAct, int requestCode, int resultCode, Intent data) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d(TAG, "ActivityResult: "+requestCode+"/"+resultCode); |  |  |  | 		//Log.d(TAG, "ActivityResult: "+requestCode+"/"+resultCode); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		switch (requestCode) { |  |  |  | 		switch (requestCode) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		case REQUEST_ACCOUNT_PICKER: |  |  |  | 		case REQUEST_ACCOUNT_PICKER: | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "ActivityResult: REQUEST_ACCOUNT_PICKER"); |  |  |  | 			//Log.d(TAG, "ActivityResult: REQUEST_ACCOUNT_PICKER"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			if (resultCode == Activity.RESULT_OK && data != null && data.getExtras() != null) { |  |  |  | 			if (resultCode == Activity.RESULT_OK && data != null && data.getExtras() != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 				String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME); |  |  |  | 				String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (accountName != null) { |  |  |  | 				if (accountName != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					Log.d(TAG, "Initialize Account name="+accountName); |  |  |  | 					//Log.d(TAG, "Initialize Account name="+accountName); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 					initializeAccountOrPath(setupAct, accountName); |  |  |  | 					initializeAccountOrPath(setupAct, accountName); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 					return; |  |  |  | 					return; | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -609,10 +609,10 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		case REQUEST_AUTHORIZATION: |  |  |  | 		case REQUEST_AUTHORIZATION: | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if (resultCode == Activity.RESULT_OK) { |  |  |  | 			if (resultCode == Activity.RESULT_OK) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 				for (String k: data.getExtras().keySet()) |  |  |  | 				//for (String k: data.getExtras().keySet()) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				{ |  |  |  | 				//{ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 					Log.d(TAG, data.getExtras().get(k).toString()); |  |  |  | 					//Log.d(TAG, data.getExtras().get(k).toString()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				//} | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 				String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME); |  |  |  | 				String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (accountName != null) { |  |  |  | 				if (accountName != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					Log.d(TAG, "Account name="+accountName); |  |  |  | 					Log.d(TAG, "Account name="+accountName); | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -669,7 +669,7 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 						AccountData newAccountData = new AccountData(); |  |  |  | 						AccountData newAccountData = new AccountData(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						newAccountData.drive = createDriveService(accountName, activity); |  |  |  | 						newAccountData.drive = createDriveService(accountName, activity); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						mAccountData.put(accountName, newAccountData); |  |  |  | 						mAccountData.put(accountName, newAccountData); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						Log.d(TAG, "Added account data for " + accountName); |  |  |  | 						//Log.d(TAG, "Added account data for " + accountName); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 						newAccountData.mFolderCache = buildFoldersCache(accountName); |  |  |  | 						newAccountData.mFolderCache = buildFoldersCache(accountName); | 
			
		
	
		
		
			
				
					
					|  |  |  | 						 |  |  |  | 						 | 
			
		
	
		
		
			
				
					
					|  |  |  | 						About about = newAccountData.drive.about().get().execute(); |  |  |  | 						About about = newAccountData.drive.about().get().execute(); | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -704,7 +704,7 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					} |  |  |  | 					} | 
			
		
	
		
		
			
				
					
					|  |  |  | 				}  else if ( isCancelled()) { |  |  |  | 				}  else if ( isCancelled()) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					// cancel handling here |  |  |  | 					// cancel handling here | 
			
		
	
		
		
			
				
					
					|  |  |  | 					Log.d(TAG,"Async Task cancelled!"); |  |  |  | 					//Log.d(TAG,"Async Task cancelled!"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 					activity.setResult(Activity.RESULT_CANCELED); |  |  |  | 					activity.setResult(Activity.RESULT_CANCELED); | 
			
		
	
		
		
			
				
					
					|  |  |  | 					activity.finish(); |  |  |  | 					activity.finish(); | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -742,12 +742,12 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private HashMap<String,FileSystemEntryData> buildFoldersCache(String accountName) throws IOException { |  |  |  | 	private HashMap<String,FileSystemEntryData> buildFoldersCache(String accountName) throws IOException { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		HashMap<String, FileSystemEntryData> folderCache = new HashMap<String, GoogleDriveFileStorage.FileSystemEntryData>(); |  |  |  | 		HashMap<String, FileSystemEntryData> folderCache = new HashMap<String, GoogleDriveFileStorage.FileSystemEntryData>(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d(TAG,"buildFoldersCache"); |  |  |  | 		//Log.d(TAG,"buildFoldersCache"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		FileList folders=getDriveService(accountName).files().list().setQ("mimeType='"+FOLDER_MIME_TYPE+"' and trashed=false and hidden=false") |  |  |  | 		FileList folders=getDriveService(accountName).files().list().setQ("mimeType='"+FOLDER_MIME_TYPE+"' and trashed=false and hidden=false") | 
			
		
	
		
		
			
				
					
					|  |  |  | 				.setFields("items(id,title,parents),nextPageToken") |  |  |  | 				.setFields("items(id,title,parents),nextPageToken") | 
			
		
	
		
		
			
				
					
					|  |  |  | 				.execute(); |  |  |  | 				.execute(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		for(File fl: folders.getItems()){ |  |  |  | 		for(File fl: folders.getItems()){ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG,"buildFoldersCache: " + fl.getTitle()); |  |  |  | 			//Log.d(TAG,"buildFoldersCache: " + fl.getTitle()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			FileSystemEntryData thisFolder = new FileSystemEntryData(); |  |  |  | 			FileSystemEntryData thisFolder = new FileSystemEntryData(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			thisFolder.id = fl.getId(); |  |  |  | 			thisFolder.id = fl.getId(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			thisFolder.displayName = fl.getTitle(); |  |  |  | 			thisFolder.displayName = fl.getTitle(); | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -759,13 +759,13 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			folderCache.put(thisFolder.id, thisFolder); |  |  |  | 			folderCache.put(thisFolder.id, thisFolder); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d(TAG,"that's it!"); |  |  |  | 		//Log.d(TAG,"that's it!"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		return folderCache; |  |  |  | 		return folderCache; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	private void finishActivityWithSuccess(FileStorageSetupActivity setupActivity) { |  |  |  | 	private void finishActivityWithSuccess(FileStorageSetupActivity setupActivity) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		Log.d("KP2AJ", "Success with authentcating!"); |  |  |  | 		//Log.d("KP2AJ", "Success with authentcating!"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		Activity activity = (Activity)setupActivity; |  |  |  | 		Activity activity = (Activity)setupActivity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 		if (setupActivity.getProcessName().equals(PROCESS_NAME_FILE_USAGE_SETUP)) |  |  |  | 		if (setupActivity.getProcessName().equals(PROCESS_NAME_FILE_USAGE_SETUP)) | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -780,13 +780,14 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		if (setupActivity.getProcessName().equals(PROCESS_NAME_SELECTFILE)) |  |  |  | 		if (setupActivity.getProcessName().equals(PROCESS_NAME_SELECTFILE)) | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Intent data = new Intent(); |  |  |  | 			Intent data = new Intent(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if (setupActivity.getState() == null) |  |  |  | 			/*if (setupActivity.getState() == null) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 				Log.d(TAG, "getState is null"); |  |  |  | 				Log.d(TAG, "getState is null"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			else  |  |  |  | 			else  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				if (setupActivity.getState().getString(EXTRA_PATH) == null) |  |  |  | 				if (setupActivity.getState().getString(EXTRA_PATH) == null) | 
			
		
	
		
		
			
				
					
					|  |  |  | 					Log.d(TAG, "setupActivity.getState().getString(EXTRA_PATH) is null"); |  |  |  | 					Log.d(TAG, "setupActivity.getState().getString(EXTRA_PATH) is null"); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				else |  |  |  | 				else | 
			
		
	
		
		
			
				
					
					|  |  |  | 					Log.d(TAG,setupActivity.getState().getString(EXTRA_PATH)); |  |  |  | 					Log.d(TAG,setupActivity.getState().getString(EXTRA_PATH)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					*/ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			String path = setupActivity.getState().getString(EXTRA_PATH); |  |  |  | 			String path = setupActivity.getState().getString(EXTRA_PATH); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			if (path != null) |  |  |  | 			if (path != null) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				data.putExtra(EXTRA_PATH, path); |  |  |  | 				data.putExtra(EXTRA_PATH, path); | 
			
		
	
	
		
		
			
				
					
					|  |  | @@ -838,7 +839,7 @@ public class GoogleDriveFileStorage implements JavaFileStorage { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		{ |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 			GoogleAccountCredential credential = createCredential(activity); |  |  |  | 			GoogleAccountCredential credential = createCredential(activity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 			Log.d(TAG, "starting REQUEST_ACCOUNT_PICKER"); |  |  |  | 			//Log.d(TAG, "starting REQUEST_ACCOUNT_PICKER"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 			activity.startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER); |  |  |  | 			activity.startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
	
		
		
			
				
					
					|  |  |   |