Created
September 3, 2014 19:06
-
-
Save brianv0/2e5cd7d3b7963c564ea5 to your computer and use it in GitHub Desktop.
Jython walk example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from java.nio.file import Files, Paths, SimpleFileVisitor, FileVisitResult | |
class visitor(SimpleFileVisitor): | |
def __init__(self): | |
pass | |
def preVisitDirectory(self, dir, attrs): | |
print(dir) | |
return FileVisitResult.CONTINUE | |
p = Paths.get(".").toAbsolutePath().normalize() | |
vtor = visitor() | |
Files.walkFileTree(p, vtor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment