Skip to content

Commit eda453f

Browse files
authored
Merge pull request #7 from ath0mas/java-format-and-clean
Android: Java format and clean
2 parents df9893d + 187b94d commit eda453f

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

src/android/ContentFilesystem.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public LocalFilesystemURL toLocalUri(Uri inputURL) {
8686

8787
@Override
8888
public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
89-
String fileName, JSONObject options, boolean directory) throws IOException, TypeMismatchException, JSONException {
89+
String fileName, JSONObject options, boolean directory) throws IOException, TypeMismatchException, JSONException {
9090
throw new UnsupportedOperationException("getFile() not supported for content:. Use resolveLocalFileSystemURL instead.");
9191
}
9292

@@ -163,9 +163,10 @@ public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws
163163

164164
@Override
165165
public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
166-
int offset, boolean isBinary) throws NoModificationAllowedException {
166+
int offset, boolean isBinary) throws NoModificationAllowedException {
167167
throw new NoModificationAllowedException("Couldn't write to file given its content URI");
168168
}
169+
169170
@Override
170171
public long truncateFileAtURL(LocalFilesystemURL inputURL, long size)
171172
throws NoModificationAllowedException {

src/android/FileUtils.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ private void getWritePermission(String rawArgs, int action, CallbackContext call
552552
* If your app targets Android 13 (SDK 33) or higher and needs to access media files that other apps have created,
553553
* you must request one or more of the following granular media permissions READ_MEDIA_*
554554
* instead of the READ_EXTERNAL_STORAGE permission:
555-
*
555+
* <p>
556556
* Refer to: https://developer.android.com/about/versions/13/behavior-changes-13
557557
*
558558
* @return
@@ -673,7 +673,6 @@ public LocalFilesystemURL filesystemURLforLocalPath(String localPath) {
673673
return localURL;
674674
}
675675

676-
677676
/* helper to execute functions async and handle the result codes
678677
*
679678
*/
@@ -848,7 +847,6 @@ private boolean removeRecursively(String baseURLstr) throws FileExistsException,
848847
}
849848
}
850849

851-
852850
/**
853851
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty.
854852
* It is an error to attempt to delete the root directory of a filesystem.
@@ -1020,7 +1018,7 @@ private JSONObject requestAllPaths() throws JSONException {
10201018
ret.put("externalRootDirectory", toDirUrl(Environment.getExternalStorageDirectory()));
10211019
} catch (NullPointerException e) {
10221020
/* If external storage is unavailable, context.getExternal* returns null */
1023-
LOG.d(LOG_TAG, "Unable to access these paths, most liklely due to USB storage");
1021+
LOG.d(LOG_TAG, "Unable to access these paths, most likely due to USB storage");
10241022
}
10251023
}
10261024
return ret;
@@ -1137,7 +1135,6 @@ public void handleData(InputStream inputStream, String contentType) {
11371135
}
11381136
}
11391137

1140-
11411138
/**
11421139
* Write contents of file.
11431140
*
@@ -1182,7 +1179,6 @@ private long truncateFile(String srcURLstr, long size) throws FileNotFoundExcept
11821179
}
11831180
}
11841181

1185-
11861182
/*
11871183
* Handle the response
11881184
*/

src/android/Filesystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public JSONObject makeEntryForFile(File file) {
106106
}
107107

108108
abstract JSONObject getFileForLocalURL(LocalFilesystemURL inputURL, String path,
109-
JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException;
109+
JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException;
110110

111111
abstract boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException, NoModificationAllowedException;
112112

@@ -295,7 +295,7 @@ public void readFileAtURL(LocalFilesystemURL inputURL, long start, long end,
295295
}
296296

297297
abstract long writeToFileAtURL(LocalFilesystemURL inputURL, String data, int offset,
298-
boolean isBinary) throws NoModificationAllowedException, IOException;
298+
boolean isBinary) throws NoModificationAllowedException, IOException;
299299

300300
abstract long truncateFileAtURL(LocalFilesystemURL inputURL, long size)
301301
throws IOException, NoModificationAllowedException;

src/android/LocalFilesystem.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public LocalFilesystemURL URLforFilesystemPath(String path) {
106106

107107
@Override
108108
public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
109-
String path, JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
109+
String path, JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
110110
boolean create = false;
111111
boolean exclusive = false;
112112

@@ -323,7 +323,7 @@ private void copyDirectory(Filesystem srcFs, LocalFilesystemURL srcURL, File dst
323323

324324
@Override
325325
public JSONObject copyFileToURL(LocalFilesystemURL destURL, String newName,
326-
Filesystem srcFs, LocalFilesystemURL srcURL, boolean move) throws IOException, InvalidModificationException, JSONException, NoModificationAllowedException, FileExistsException {
326+
Filesystem srcFs, LocalFilesystemURL srcURL, boolean move) throws IOException, InvalidModificationException, JSONException, NoModificationAllowedException, FileExistsException {
327327

328328
// Check to see if the destination directory exists
329329
String newParent = this.filesystemPathForURL(destURL);
@@ -370,7 +370,7 @@ public JSONObject copyFileToURL(LocalFilesystemURL destURL, String newName,
370370

371371
@Override
372372
public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
373-
int offset, boolean isBinary) throws IOException, NoModificationAllowedException {
373+
int offset, boolean isBinary) throws IOException, NoModificationAllowedException {
374374

375375
boolean append = false;
376376
if (offset > 0) {
@@ -385,8 +385,7 @@ public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
385385
rawData = data.getBytes(Charset.defaultCharset());
386386
}
387387
ByteArrayInputStream in = new ByteArrayInputStream(rawData);
388-
try
389-
{
388+
try {
390389
byte buff[] = new byte[rawData.length];
391390
String absolutePath = filesystemPathForURL(inputURL);
392391
FileOutputStream out = new FileOutputStream(absolutePath, append);

0 commit comments

Comments
 (0)