Changeset 1387
- Timestamp:
- 05/28/19 11:15:25 (5 years ago)
- Location:
- trunk/src/org/expeditee/auth
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/Actions.java
r1386 r1387 1 1 package org.expeditee.auth; 2 2 3 import java.awt.Desktop;4 3 import java.io.File; 5 4 import java.io.FileNotFoundException; 6 5 import java.io.IOException; 7 import java.net.URI;8 import java.net.URISyntaxException;9 import java.net.URL;10 6 import java.nio.file.Files; 11 7 import java.nio.file.Path; … … 44 40 import org.expeditee.auth.account.Authenticate; 45 41 import org.expeditee.auth.account.Authenticate.AuthenticationResult; 42 import org.expeditee.auth.account.Contacts; 46 43 import org.expeditee.auth.account.Create; 47 44 import org.expeditee.auth.account.Create.CreateResult; … … 208 205 } 209 206 public static String AuthDistributeContactDetails(String username) { 210 StringBuilder sb = new StringBuilder(); 211 String nl = System.getProperty("line.separator"); 212 String me = UserSettings.UserName.get(); 213 Path profilePath = Paths.get(FrameIO.PROFILE_PATH).resolve(me); 214 try { 215 Desktop.getDesktop().open(profilePath.toFile()); 216 sb.append("1. We have opened your profile directory for you. Tab to it and right click on the " + me + "-credentials directory." + nl); 217 } catch (IOException e) { 218 sb.append("1. Open your profile directory (" + profilePath + ") and right click on the " + me + "-credentials directory." + nl); 219 } 220 221 sb.append("2. Click on 'Share with Google Drive'." + nl); 222 sb.append("3. Enter " + username + "'s in the text box." + nl); 223 sb.append("4. Click on the button to the right of the text box in order to set the share to 'View Only'." + nl); 224 sb.append("5. Optionally add a note for " + username + " to read. Click the send button."); 225 226 return sb.toString(); 207 return Contacts.distributeContactDetails(username); 227 208 } 228 209 public static void AuthAddContactDetails() { … … 230 211 } 231 212 public static String AuthAddContactDetails(String username) { 232 StringBuilder sb = new StringBuilder(); 233 String nl = System.getProperty("line.separator"); 234 String me = UserSettings.UserName.get(); 235 String driveSharedWithMeString = "https://drive.google.com/drive/shared-with-me"; 236 try { 237 URI driveSharedWithMeURL = new URL(driveSharedWithMeString).toURI(); 238 Desktop.getDesktop().browse(driveSharedWithMeURL); 239 sb.append("1. We have opened Google Drive to the 'Shared With Me' page in your browser. Right click on " + username + "-credentials and click on 'Add To My Drive'." + nl); 240 } catch (IOException | URISyntaxException e) { 241 sb.append("1. Open your web browser to " + driveSharedWithMeString + ". Right click on " + username + "-credentials and click on 'Add To My Drive'." + nl); 242 } 243 244 sb.append("2. Click organise and navigate the dialog to resources-" + me + "/contacts and click the 'Move Here' button to relocate your copy of " + username + "'s credentials folder."); 245 246 return sb.toString(); 213 return Contacts.addContactDetails(username); 247 214 } 248 215 // End Making Contacts Actions
Note:
See TracChangeset
for help on using the changeset viewer.