Skip to content

Commit

Permalink
Refactor: Remove unused remote file service method
Browse files Browse the repository at this point in the history
After removal of remote archive file system.
  • Loading branch information
zhanghai committed Oct 7, 2024
1 parent aa55f9c commit 5987ac4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ interface IRemoteFileService {
IRemotePosixFileAttributeView getRemotePosixFileAttributeViewInterface(
in ParcelableObject attributeView
);

void setArchivePasswords(in ParcelableObject fileSystem, in List<String> passwords);

void refreshArchiveFileSystem(in ParcelableObject fileSystem);
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ internal class ArchiveFileSystem(
}
}

fun setPasswords(passwords: List<String>) {
synchronized(lock) {
if (!isOpen) {
throw ClosedFileSystemException()
}
this.passwords = passwords
}
}

fun refresh() {
synchronized(lock) {
if (!isOpen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ fun Path.archiveAddPassword(password: String) {
fileSystem.addPassword(password)
}

fun Path.archiveSetPasswords(passwords: List<String>) {
this as? ArchivePath ?: throw ProviderMismatchException(toString())
fileSystem.setPasswords(passwords)
}

val Path.archiveFile: Path
get() {
this as? ArchivePath ?: throw ProviderMismatchException(toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,4 @@ abstract class RemoteFileService(private val remoteInterface: RemoteInterface<IR
remoteInterface.get().call {
getRemotePosixFileAttributeViewInterface(attributeView.toParcelable())
}

@Throws(RemoteFileSystemException::class)
fun setArchivePasswords(fileSystem: FileSystem, passwords: List<String>) {
remoteInterface.get().call { setArchivePasswords(fileSystem.toParcelable(), passwords) }
}

@Throws(RemoteFileSystemException::class)
fun refreshArchiveFileSystem(fileSystem: FileSystem) {
remoteInterface.get().call { refreshArchiveFileSystem(fileSystem.toParcelable()) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

package me.zhanghai.android.files.provider.remote

import java8.nio.file.FileSystem
import me.zhanghai.android.files.provider.FileSystemProviders
import me.zhanghai.android.files.provider.archive.archiveRefresh
import me.zhanghai.android.files.provider.archive.archiveSetPasswords

open class RemoteFileServiceInterface : IRemoteFileService.Stub() {
override fun getRemoteFileSystemProviderInterface(scheme: String): IRemoteFileSystemProvider =
Expand All @@ -25,12 +22,4 @@ open class RemoteFileServiceInterface : IRemoteFileService.Stub() {
attributeView: ParcelableObject
): IRemotePosixFileAttributeView =
RemotePosixFileAttributeViewInterface(attributeView.value())

override fun setArchivePasswords(fileSystem: ParcelableObject, passwords: List<String>) {
fileSystem.value<FileSystem>().getPath("").archiveSetPasswords(passwords)
}

override fun refreshArchiveFileSystem(fileSystem: ParcelableObject) {
fileSystem.value<FileSystem>().getPath("").archiveRefresh()
}
}

0 comments on commit 5987ac4

Please sign in to comment.