@Override public Path getSettingsPath() { Path path = Paths.get( Shell32Util.getFolderPath(ShlObj.CSIDL_MYDOCUMENTS) ).resolve("ArduinoData"); if (Files.exists(path)) { return path; } path = Paths.get( Shell32Util.getFolderPath(ShlObj.CSIDL_LOCAL_APPDATA) ).resolve("Arduino15"); if ( Files.exists(path) ) { return path; } path = Paths.get(Shell32Util.getFolderPath(ShlObj.CSIDL_APPDATA) ).resolve("Arduino15"); if ( Files.exists(path) ) { return path; } return null; }
@Override public Path getSketchPath() { return Paths.get( Shell32Util.getFolderPath(ShlObj.CSIDL_MYDOCUMENTS) ).resolve("Arduino"); }
private File getHome() { return new File(Shell32Util.getKnownFolderPath(KnownFolders.FOLDERID_RoamingAppData), appName); }
@Nonnull @Override public File getExternalPlatformDirectory(@Nonnull File defaultPath) { return new File(Shell32Util.getFolderPath(ShlObj.CSIDL_APPDATA), "Consulo Platform"); }
@Nonnull @Override protected String getDocumentsDirNoPrefix() { return Shell32Util.getFolderPath(ShlObj.CSIDL_PERSONAL); }
@Nonnull @Override protected String getLocalSettingsDirNoPrefix() { // will return path like C:\Users\{user.name}\AppData\Local return Shell32Util.getFolderPath(ShlObj.CSIDL_LOCAL_APPDATA); }
@Nonnull @Override protected String getRoamingSettingsDirNoPrefix() { // will return path like C:\Users\{user.name}\AppData\Roaming return Shell32Util.getFolderPath(ShlObj.CSIDL_APPDATA); }
/************************************************************************* * Reads the current location of the app data folder from the registry. * * @return a path to the folder. ************************************************************************/ private String getAppFolder() { return Shell32Util.getFolderPath(ShlObj.CSIDL_APPDATA); }