Skip to content

Commit

Permalink
Merge pull request #12964 from Bensikrac/master
Browse files Browse the repository at this point in the history
Replaced own walkFileTree with correct implementation from nnio package.
  • Loading branch information
AndyScherzinger authored May 21, 2024
2 parents 3be52a1 + a04edc5 commit 4be4841
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ dependencies {
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.12.1'
implementation 'org.lukhnos:nnio:0.3'
implementation 'org.lukhnos:nnio:0.3.1'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.78.1'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.github.nextcloud-deps:sectioned-recyclerview:0.6.1'
Expand Down
20 changes: 0 additions & 20 deletions app/src/main/java/com/owncloud/android/utils/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation;

import org.lukhnos.nnio.file.FileVisitResult;
import org.lukhnos.nnio.file.FileVisitor;
import org.lukhnos.nnio.file.Path;
import org.lukhnos.nnio.file.impl.FileBasedPathImpl;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -68,19 +63,4 @@ Long getCreationTimestamp(File file) {
return null;
}
}

public static Path walkFileTree(Path start, FileVisitor<? super Path> visitor) throws IOException {
if (org.lukhnos.nnio.file.Files.isDirectory(start)) {
org.lukhnos.nnio.file.FileVisitResult preVisitDirectoryResult = visitor.preVisitDirectory(start, null);
if (preVisitDirectoryResult == FileVisitResult.CONTINUE) {
for (File child : start.toFile().listFiles()) {
walkFileTree(FileBasedPathImpl.get(child), visitor);
}
}
visitor.postVisitDirectory(start, null);
} else {
visitor.visitFile(start, new org.lukhnos.nnio.file.attribute.BasicFileAttributes(start.toFile()));
}
return start;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.lukhnos.nnio.file.Paths;
import org.lukhnos.nnio.file.SimpleFileVisitor;
import org.lukhnos.nnio.file.attribute.BasicFileAttributes;
import org.lukhnos.nnio.file.Files;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -63,7 +64,7 @@ private static void insertCustomFolderIntoDB(Path path,
final long enabledTimestampMs = syncedFolder.getEnabledTimestampMs();

try {
FileUtil.walkFileTree(path, new SimpleFileVisitor<>() {
Files.walkFileTree(path, new SimpleFileVisitor<>() {
@Override
public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
File file = path.toFile();
Expand Down Expand Up @@ -91,7 +92,7 @@ public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
if (syncedFolder.isExcludeHidden() && dir.compareTo(Paths.get(syncedFolder.getLocalPath())) != 0 && dir.toFile().isHidden()) {
return null;
return FileVisitResult.SKIP_SUBTREE;
}
return FileVisitResult.CONTINUE;
}
Expand Down
9 changes: 9 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
</trusted-key>
<trusted-key id="4F8FEC6785F611D9A712EA2734918B7D3969D2F5" group="com.google.dagger" name="dagger" version="2.28.3"/>
<trusted-key id="508B736B26AA4F672A10B92C4F91D100EB1F597B" group="org.lukhnos" name="nnio" version="0.3"/>
<trusted-key id="508B736B26AA4F672A10B92C4F91D100EB1F597B" group="org.lukhnos" name="nnio" version="0.3.1"/>
<trusted-key id="517B94F8D0A46317A28D8AB30DA8A5EC02D11EAD" group="net.sf.jopt-simple" name="jopt-simple" version="4.9"/>
<trusted-key id="51B52DC5DD452F92BE342CC2858FC4C4F43856A3" group="xerces" name="xercesImpl" version="2.12.0"/>
<trusted-key id="51BF0A126F41293F40F50A0B8CD7D660AE857DAD" group="com.getkeepsafe.relinker" name="relinker" version="1.4.5"/>
Expand Down Expand Up @@ -10228,6 +10229,14 @@
<sha256 value="238a7a2002efa66df2cfd313be3ce22a7d206d6ebbfe6b48e0652587830cb2bd" origin="Generated by Gradle" reason="A key couldn't be downloaded"/>
</artifact>
</component>
<component group="org.lukhnos" name="nnio" version="0.3.1">
<artifact name="nnio-0.3.1.jar">
<sha256 value="9c411e08406977f2c2027fd8c2790dba1d688a0fca466436a84bf6398943e484" origin="Generated by Gradle"/>
</artifact>
<artifact name="nnio-0.3.1.module">
<sha256 value="ece61075ffbd0c68b66a101689e5e7e8340a73505cab46d231e7c8a4b27aff27" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.mnode.ical4j" name="ical4j" version="3.0.0">
<artifact name="ical4j-3.0.0.jar">
<sha256 value="847ca726fab2b61b95d389a48693f0ca67fcc591a1bccc6f43057157daa433d0" origin="Generated by Gradle"/>
Expand Down

0 comments on commit 4be4841

Please sign in to comment.