32
32
public class FileManager {
33
33
34
34
@ Inject
35
- public FileManager () {}
35
+ FileManager () {}
36
36
37
37
/**
38
38
* Writes a file to Disk.
@@ -41,7 +41,7 @@ public FileManager() {}
41
41
*
42
42
* @param file The file to write to Disk.
43
43
*/
44
- public void writeToFile (File file , String fileContent ) {
44
+ void writeToFile (File file , String fileContent ) {
45
45
if (!file .exists ()) {
46
46
try {
47
47
FileWriter writer = new FileWriter (file );
@@ -61,15 +61,15 @@ public void writeToFile(File file, String fileContent) {
61
61
* @param file The file to read from.
62
62
* @return A string with the content of the file.
63
63
*/
64
- public String readFileContent (File file ) {
64
+ String readFileContent (File file ) {
65
65
StringBuilder fileContentBuilder = new StringBuilder ();
66
66
if (file .exists ()) {
67
67
String stringLine ;
68
68
try {
69
69
FileReader fileReader = new FileReader (file );
70
70
BufferedReader bufferedReader = new BufferedReader (fileReader );
71
71
while ((stringLine = bufferedReader .readLine ()) != null ) {
72
- fileContentBuilder .append (stringLine + "\n " );
72
+ fileContentBuilder .append (stringLine ). append ( "\n " );
73
73
}
74
74
bufferedReader .close ();
75
75
fileReader .close ();
@@ -87,7 +87,7 @@ public String readFileContent(File file) {
87
87
* @param file The file to check existence.
88
88
* @return true if this file exists, false otherwise.
89
89
*/
90
- public boolean exists (File file ) {
90
+ boolean exists (File file ) {
91
91
return file .exists ();
92
92
}
93
93
@@ -98,7 +98,7 @@ public boolean exists(File file) {
98
98
*
99
99
* @param directory The directory which its content will be deleted.
100
100
*/
101
- public boolean clearDirectory (File directory ) {
101
+ boolean clearDirectory (File directory ) {
102
102
boolean result = false ;
103
103
if (directory .exists ()) {
104
104
for (File file : directory .listFiles ()) {
@@ -116,7 +116,7 @@ public boolean clearDirectory(File directory) {
116
116
* @param key A string for the key that will be used to retrieve the value in the future.
117
117
* @param value A long representing the value to be inserted.
118
118
*/
119
- public void writeToPreferences (Context context , String preferenceFileName , String key ,
119
+ void writeToPreferences (Context context , String preferenceFileName , String key ,
120
120
long value ) {
121
121
122
122
SharedPreferences sharedPreferences = context .getSharedPreferences (preferenceFileName ,
@@ -134,7 +134,7 @@ public void writeToPreferences(Context context, String preferenceFileName, Strin
134
134
* @param key A key that will be used to retrieve the value from the preference file.
135
135
* @return A long representing the value retrieved from the preferences file.
136
136
*/
137
- public long getFromPreferences (Context context , String preferenceFileName , String key ) {
137
+ long getFromPreferences (Context context , String preferenceFileName , String key ) {
138
138
SharedPreferences sharedPreferences = context .getSharedPreferences (preferenceFileName ,
139
139
Context .MODE_PRIVATE );
140
140
return sharedPreferences .getLong (key , 0 );
0 commit comments