Skip to content

Commit

Permalink
run spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Dec 10, 2023
1 parent 22f6c22 commit 932e9e5
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SshAuthenticationTask(
)
)
} else if (TransportException::class.java
.isAssignableFrom(error.javaClass)
.isAssignableFrom(error.javaClass)
) {
val disconnectReason =
TransportException::class.java.cast(error)!!.disconnectReason
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ public WriteTextFileCallable(
@WorkerThread
@Override
public Unit call()
throws IOException,
StreamNotFoundException,
ShellNotRunningException,
throws IOException, StreamNotFoundException, ShellNotRunningException,
IllegalArgumentException {
OutputStream outputStream;
File destFile = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class FtpService : Service(), Runnable {
@JvmStatic
fun defaultPath(context: Context): String {
return if (PreferenceManager.getDefaultSharedPreferences(context)
.getBoolean(KEY_PREFERENCE_SAF_FILESYSTEM, false) && SDK_INT > M
.getBoolean(KEY_PREFERENCE_SAF_FILESYSTEM, false) && SDK_INT > M
) {
DocumentsContract.buildTreeDocumentUri(
"com.android.externalstorage.documents",
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/java/com/amaze/filemanager/database/UtilsHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ class UtilsHandler(
get() {
val paths = LinkedList<String>()
for (
history in utilitiesDatabase.historyEntryDao().list().subscribeOn(Schedulers.io())
.blockingGet()
history in utilitiesDatabase.historyEntryDao().list().subscribeOn(Schedulers.io())
.blockingGet()
) {
paths.add(history.path)
}
Expand All @@ -237,8 +237,8 @@ class UtilsHandler(
get() {
val paths = ConcurrentRadixTree<VoidValue>(DefaultCharArrayNodeFactory())
for (
path in utilitiesDatabase.hiddenEntryDao().listPaths().subscribeOn(Schedulers.io())
.blockingGet()
path in utilitiesDatabase.hiddenEntryDao().listPaths().subscribeOn(Schedulers.io())
.blockingGet()
) {
paths.put(path, VoidValue.SINGLETON)
}
Expand Down Expand Up @@ -268,8 +268,8 @@ class UtilsHandler(
get() {
val row = ArrayList<Array<String>>()
for (
bookmark in utilitiesDatabase.bookmarkEntryDao().list()
.subscribeOn(Schedulers.io()).blockingGet()
bookmark in utilitiesDatabase.bookmarkEntryDao().list()
.subscribeOn(Schedulers.io()).blockingGet()
) {
row.add(arrayOf(bookmark.name, bookmark.path))
}
Expand All @@ -283,8 +283,8 @@ class UtilsHandler(
get() {
val retval = ArrayList<Array<String>>()
for (
entry in utilitiesDatabase.smbEntryDao().list().subscribeOn(Schedulers.io())
.blockingGet()
entry in utilitiesDatabase.smbEntryDao().list().subscribeOn(Schedulers.io())
.blockingGet()
) {
try {
retval.add(arrayOf(entry.name, entry.path))
Expand Down Expand Up @@ -322,8 +322,8 @@ class UtilsHandler(
get() {
val retval = ArrayList<Array<String>>()
for (
entry in utilitiesDatabase.sftpEntryDao().list().subscribeOn(Schedulers.io())
.blockingGet()
entry in utilitiesDatabase.sftpEntryDao().list().subscribeOn(Schedulers.io())
.blockingGet()
) {
val path = entry.path
if (path == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ object FileProperties {
return if (ANDROID_DEVICE_DATA_DIRS.containsPath(path)) {
path
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q && ANDROID_DEVICE_DATA_DIRS.any {
path.startsWith(it) && path != it
}
path.startsWith(it) && path != it
}
) {
val suffix =
path.substringAfter(Environment.getExternalStorageDirectory().absolutePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class DragAndDropDialog : DialogFragment() {
)
}
}
private fun newInstance(pasteLocation: String, files: ArrayList<HybridFileParcelable>): DragAndDropDialog {
private fun newInstance(pasteLocation: String, files: ArrayList<HybridFileParcelable>):
DragAndDropDialog {
val dragAndDropDialog = DragAndDropDialog()
val args = Bundle()
args.putString(KEY_PASTE_LOCATION, pasteLocation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ class OpenFileDialogFragment : BaseBottomSheetFragment(), AdjustListViewForTv<Ap
if (mimeType == MimeTypes.ALL_MIME_TYPES ||
forceChooser ||
!getPreferenceAndStartActivity(
uri,
mimeType,
useNewStack,
activity
)
uri,
mimeType,
useNewStack,
activity
)
) {
if (forceChooser) {
clearMimeTypePreference(
Expand All @@ -115,7 +115,8 @@ class OpenFileDialogFragment : BaseBottomSheetFragment(), AdjustListViewForTv<Ap
}
}

private fun newInstance(uri: Uri, mimeType: String, useNewStack: Boolean): OpenFileDialogFragment {
private fun newInstance(uri: Uri, mimeType: String, useNewStack: Boolean):
OpenFileDialogFragment {
val args = Bundle()

val fragment = OpenFileDialogFragment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class RecyclerAdapterDragListener(
TAG,
"Didn't find checked items in adapter, " +
"checking dataUtils size ${
dataUtils.checkedItemsList?.size ?: "null"}"
dataUtils.checkedItemsList?.size ?: "null"}"
)
checkedItems = dataUtils.checkedItemsList
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class CompressedExplorerFragment : Fragment(), BottomBarButtonPath {
if (SDK_INT >= LOLLIPOP) {
val window = requireActivity().window
if (requireMainActivity()
.getBoolean(PreferencesConstants.PREFERENCE_COLORED_NAVIGATION)
.getBoolean(PreferencesConstants.PREFERENCE_COLORED_NAVIGATION)
) {
window.navigationBarColor =
Utils.getColor(context, android.R.color.black)
Expand Down Expand Up @@ -508,7 +508,7 @@ class CompressedExplorerFragment : Fragment(), BottomBarButtonPath {
if (SDK_INT >= LOLLIPOP) {
val window = requireActivity().window
if (requireMainActivity()
.getBoolean(PreferencesConstants.PREFERENCE_COLORED_NAVIGATION)
.getBoolean(PreferencesConstants.PREFERENCE_COLORED_NAVIGATION)
) {
window.navigationBarColor =
requireMainActivity().skinStatusBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ class FtpServerFragment : Fragment(R.layout.fragment_ftp) {
}

@Suppress("LabeledExpression")
private fun createOpenDocumentTreeIntentCallback(callback: (directoryUri: Uri) -> Unit): ActivityResultLauncher<Intent> {
private fun createOpenDocumentTreeIntentCallback(callback: (directoryUri: Uri) -> Unit):
ActivityResultLauncher<Intent> {
return registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ class SecurityPrefsFragment : BasePrefsFragment() {

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 ||
activity.prefs.getBoolean(
PreferencesConstants.PREFERENCE_CRYPT_FINGERPRINT,
false
)
PreferencesConstants.PREFERENCE_CRYPT_FINGERPRINT,
false
)
) {
// encryption feature not available
masterPasswordPreference?.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class MainActivityActionMode(private val mainActivityReference: WeakReference<Ma
}

if (mainFragmentViewModel.openMode != OpenMode.FILE && !mainFragmentViewModel
.getIsCloudOpenMode()
.getIsCloudOpenMode()
) {
hideOption(R.id.addshortcut, menu)
hideOption(R.id.compress, menu)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CompressedHelperForBadArchiveTest {

private fun doTestBadArchive(data: ByteArray) {
for (
archiveType in supportedArchiveExtensions().subtract(excludedArchiveTypes)
archiveType in supportedArchiveExtensions().subtract(excludedArchiveTypes)
) {
val badArchive = File(
Environment.getExternalStorageDirectory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ class UtilsHandlerTest {
Pair(it[0], it[1])
}
for (
d in arrayOf(
DIRECTORY_DOWNLOADS,
DIRECTORY_DCIM,
DIRECTORY_MUSIC,
DIRECTORY_MOVIES,
DIRECTORY_PICTURES
)
d in arrayOf(
DIRECTORY_DOWNLOADS,
DIRECTORY_DCIM,
DIRECTORY_MUSIC,
DIRECTORY_MOVIES,
DIRECTORY_PICTURES
)
) {
assertTrue(
verify.contains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ class HybridFileTest {
@Test
fun testGetName() {
for (
name: String in arrayOf(
"newfolder",
"new folder 2",
"new%20folder%203",
"あいうえお"
)
name: String in arrayOf(
"newfolder",
"new folder 2",
"new%20folder%203",
"あいうえお"
)
) {
val file = HybridFile(OpenMode.FTP, "ftp://user:[email protected]/$name")
assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ open class FtpHybridFileTest {
@FlakyTest()
fun testMkdir() {
for (
dir: String in arrayOf(
dir: String in arrayOf(
// "newfolder",
// "new folder 2",
"new%20folder%203",
"あいうえお",
"multiple/levels/down the pipe"
)
"new%20folder%203",
"あいうえお",
"multiple/levels/down the pipe"
)
) {
val newFile = HybridFile(OpenMode.FTP, "$ftpUrl/$dir")
val latch = CountDownLatch(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ static void addUsbOtgDevice(Activity activity) {

@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
static void configureUsbDevice(UsbDevice device)
throws NoSuchMethodException,
ClassNotFoundException,
InvocationTargetException,
InstantiationException,
IllegalAccessException {
throws NoSuchMethodException, ClassNotFoundException, InvocationTargetException,
InstantiationException, IllegalAccessException {
UsbConfiguration usbConfiguration = callUsbConfigurationConstructor(0, "", 0, 0);
configureUsbConfiguration(usbConfiguration);

Expand All @@ -94,11 +91,8 @@ static void configureUsbDevice(UsbDevice device)

@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
static void configureUsbConfiguration(UsbConfiguration usbConfiguration)
throws NoSuchMethodException,
ClassNotFoundException,
InvocationTargetException,
InstantiationException,
IllegalAccessException {
throws NoSuchMethodException, ClassNotFoundException, InvocationTargetException,
InstantiationException, IllegalAccessException {
UsbInterface usbInterface =
callUsbInterfaceConstructor(01, 0, "", USB_CLASS_MASS_STORAGE, 0, 0);

Expand All @@ -109,11 +103,8 @@ static void configureUsbConfiguration(UsbConfiguration usbConfiguration)

@RequiresApi(Build.VERSION_CODES.KITKAT)
static Parcelable[] configureUsbDevice()
throws ClassNotFoundException,
NoSuchMethodException,
InvocationTargetException,
InstantiationException,
IllegalAccessException {
throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
InstantiationException, IllegalAccessException {
UsbInterface usbInterface =
(UsbInterface) callUsbInterfaceConstructor(01, USB_CLASS_MASS_STORAGE, 0, 0, null);

Expand All @@ -132,11 +123,8 @@ static UsbDevice callUsbDeviceConstructor(
@Nullable String productName,
@NonNull String version,
@Nullable String serialNumber)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {

Class<UsbDevice> clazz = (Class<UsbDevice>) Class.forName("android.hardware.usb.UsbDevice");
Constructor<UsbDevice> constructor =
Expand Down Expand Up @@ -176,11 +164,8 @@ static UsbDevice callUsbDeviceConstructor(
@Nullable String manufacturerName,
@Nullable String productName,
@Nullable String serialNumber)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {

Class<UsbDevice> clazz = (Class<UsbDevice>) Class.forName("android.hardware.usb.UsbDevice");
Constructor<UsbDevice> constructor =
Expand Down Expand Up @@ -216,11 +201,8 @@ static UsbDevice callUsbDeviceConstructor(
int subClass,
int protocol,
@NonNull Parcelable[] interfaces)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {

Class<UsbDevice> clazz = (Class<UsbDevice>) Class.forName("android.hardware.usb.UsbDevice");
Constructor<UsbDevice> constructor =
Expand All @@ -240,11 +222,8 @@ static UsbDevice callUsbDeviceConstructor(
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
static UsbConfiguration callUsbConfigurationConstructor(
int id, @Nullable String name, int attributes, int maxPower)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {

Class<UsbConfiguration> clazz =
(Class<UsbConfiguration>) Class.forName("android.hardware.usb.UsbConfiguration");
Expand All @@ -257,11 +236,8 @@ static UsbConfiguration callUsbConfigurationConstructor(
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
static UsbInterface callUsbInterfaceConstructor(
int id, int alternateSetting, @Nullable String name, int usbClass, int subClass, int protocol)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {

Class<UsbInterface> clazz =
(Class<UsbInterface>) Class.forName("android.hardware.usb.UsbInterface");
Expand All @@ -274,11 +250,8 @@ static UsbInterface callUsbInterfaceConstructor(
@RequiresApi(Build.VERSION_CODES.KITKAT)
static UsbInterface callUsbInterfaceConstructor(
int id, int usbClass, int subClass, int protocol, @Nullable Parcelable[] endpoints)
throws ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {

Class<UsbInterface> clazz =
(Class<UsbInterface>) Class.forName("android.hardware.usb.UsbInterface");
Expand Down

0 comments on commit 932e9e5

Please sign in to comment.