-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New features and unit tests enhancements (#289)
* Changes per code review * Removing the harmless ResourceNotFoundException * Putting it back * We clear the browser session so that a user can log in with different accounts * Misc * Useless * Making the Strava upload asynchronous to speed up the upload * Renaming the field per Wolfgang suggestion * Putting fields, which belong together, into { ... }, for better readability * displaying the account user name in the upload dialog * Misc * Export Unit tests update and successful * Unit tests * Unit tests update after this fix 20bb310 * XML Unit 2.8.2 * Using OauthConstants * Typo * Unit tests update * Dropbox Authentication modifications (Using external browser and PKCE implementation) (#38) * Readme update * Misc * Adding the number of tours in the progress bar message * Translation typos * Trying to renew the token right before uploading the tours * Default button is now at the bottom of the page * Putting constructLocalExpireAtDateTime in TimeTools for reuse * the icon is at the beginning of the line and the dots are removed * removing the prefstore listener when closed * 2021 * Removing the colons from the labels * Misc * Use a more random number for the port (4917) and displyaing an error message if it's not available. * Misc * Changing the Dropbox Url * Using the external browser for Strava as well * Misc * Misc * Upper case for public fields * Protected * Misc improvements * English typos * Removing the code that is too context specific * Expires At is now at the bottom * V2 ? * Per code review * Removing slf4j warnings * Adding the ability to upload manual tours to Strava (#40) * Renaming * No dot * TCX Export Enhancement and fixes (#41) * Readme update * Misc * Stopping the server when leaving the preference page * SOnarLint * Misc * Date * TCX Export Enhancement and fixes (#287) * Changes per code review * Removing the harmless ResourceNotFoundException * Putting it back * We clear the browser session so that a user can log in with different accounts * Misc * Useless * Making the Strava upload asynchronous to speed up the upload * Renaming the field per Wolfgang suggestion * Putting fields, which belong together, into { ... }, for better readability * displaying the account user name in the upload dialog * Misc * Export Unit tests update and successful * Unit tests * Unit tests update after this fix 20bb310 * XML Unit 2.8.2 * Using OauthConstants * Typo * Unit tests update * Dropbox Authentication modifications (Using external browser and PKCE implementation) (#38) * Readme update * Misc * Adding the number of tours in the progress bar message * Translation typos * Trying to renew the token right before uploading the tours * Default button is now at the bottom of the page * Putting constructLocalExpireAtDateTime in TimeTools for reuse * the icon is at the beginning of the line and the dots are removed * removing the prefstore listener when closed * 2021 * Removing the colons from the labels * Misc * Use a more random number for the port (4917) and displyaing an error message if it's not available. * Misc * Changing the Dropbox Url * Using the external browser for Strava as well * Misc * Misc * Upper case for public fields * Protected * Misc improvements * English typos * Removing the code that is too context specific * Expires At is now at the bottom * V2 ? * Per code review * Removing slf4j warnings * Adding the ability to upload manual tours to Strava (#40) * Renaming * No dot * TCX Export Enhancement and fixes (#41) * Readme update * Misc * Stopping the server when leaving the preference page * SOnarLint * Misc * Date * Missed commiting that file * Adding the possibility to configure a User Agent for each map provider (#42) * Added the possibility to export the current map view to an image file (jpg, png or bmp) * Activating the FitLog and FitLogEx unit tests (#45) * Renaming the action text and adding a tooltip * Improvements after more testing * Adding the action to export the map view in the clipboard * No image * 2 in 1 * Adding source * French translation * Indentation * Code improvement * Revert * Fixed a bug where the authentication would not work if the browser's response was too long (in french for example). Fixed the browser's response for languages with accents * Using the Http Constant * Using the Http Constant * Code improvements * putting the export actions into a submenu action * Found code to polish when I inspired myself for the export map submenu * Adding tooltip for the searchtourbylocation
- Loading branch information
Showing
54 changed files
with
24,683 additions
and
19,948 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
bundles/net.tourbook.common/src/net/tourbook/common/util/FilesUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2021 Frédéric Bard | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA | ||
*******************************************************************************/ | ||
|
||
package net.tourbook.common.util; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
import net.tourbook.common.UI; | ||
|
||
public final class FilesUtils { | ||
|
||
public static String readFileContentString(final String filePath) { | ||
|
||
String fileContent = UI.EMPTY_STRING; | ||
try { | ||
fileContent = Files.readString(Paths.get(filePath), StandardCharsets.US_ASCII); | ||
} catch (final IOException e) { | ||
StatusUtil.log(e); | ||
} | ||
return fileContent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.