-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from alessandro-candon/feature/refactor2
feat(refactor): use sonarlint and splotless to lint files
- Loading branch information
Showing
10 changed files
with
56 additions
and
21 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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/alessandrocandon/fakeoauth2/exception/IORuntimeException.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,8 @@ | ||
/* Decathlon Italy - Tacos Team(C) 2024 */ | ||
package com.alessandrocandon.fakeoauth2.exception; | ||
|
||
public class IORuntimeException extends RuntimeException { | ||
public IORuntimeException(String message) { | ||
super(message); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
.../com/alessandrocandon/fakeoauth2/exception/NotSupportedConfigurationRuntimeException.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,8 @@ | ||
/* Decathlon Italy - Tacos Team(C) 2024 */ | ||
package com.alessandrocandon.fakeoauth2.exception; | ||
|
||
public class NotSupportedConfigurationRuntimeException extends RuntimeException { | ||
public NotSupportedConfigurationRuntimeException(String message) { | ||
super(message); | ||
} | ||
} |
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
6 changes: 5 additions & 1 deletion
6
src/main/java/com/alessandrocandon/fakeoauth2/util/FileUtil.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 |
---|---|---|
@@ -1,19 +1,23 @@ | ||
/* Decathlon Italy - Tacos Team(C) 2024 */ | ||
package com.alessandrocandon.fakeoauth2.util; | ||
|
||
import com.alessandrocandon.fakeoauth2.exception.IORuntimeException; | ||
import java.io.*; | ||
import java.nio.charset.StandardCharsets; | ||
import org.springframework.core.io.ClassPathResource; | ||
import org.springframework.util.FileCopyUtils; | ||
|
||
public class FileUtil { | ||
|
||
private FileUtil() {} | ||
|
||
public static String getResourceFileAsString(String fileName) { | ||
try { | ||
ClassPathResource resource = new ClassPathResource(fileName); | ||
byte[] binaryData = FileCopyUtils.copyToByteArray(resource.getInputStream()); | ||
return new String(binaryData, StandardCharsets.UTF_8); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
throw new IORuntimeException("Cannot Read Resource File: " + fileName); | ||
} | ||
} | ||
} |