#SCRIPT:  /home/jbf/ct/hudson/script/test070//demo1869_2.jy
#from java.util.logging import Logger,Level
#Logger.getLogger('das2.filesystem').setLevel(Level.FINER)
from org.das2.util.filesystem import FileSystem

print 'version 20180824_a'

from java.util.logging import Level
from org.das2.util import LoggerManager

LoggerManager.getLogger('das2.filesystem').setLevel( Level.FINER )

LoggerManager.getLogger('das2.filesystem').fine('demo1869_2')

FileSystem.reset()

fs= FileSystem.create('https://jfaden.net/~jbf/autoplot/tests/fsm/')
print "fs.listDirectory('/Spaß/')"
import java.lang.String
s= java.lang.String( [ 47,83,112,97,-61,-97,47], 'UTF-8' )
print s, type(s)

#print len(s)
ffs= fs.listDirectory(s)
for f in ffs:
    print '26 ', f

print '=== listDirectory ==='

ffs= fs.listDirectory( "/" )
for f in ffs:
    print f
    if ( f.endswith('/') ):
       ffs2= fs.listDirectory( "/"+f )
       for f2 in ffs2:
          print '\-', f2
        
print '=== tests/fsm ==='
FileSystem.reset()
fs= FileSystem.create('https://jfaden.net/~jbf/autoplot/tests/fsm/')
spec= ".*/.*.png"
ffs= fs.listDirectoryDeep( "/", spec );
for f in ffs:
    print f
    
print '=== characters ==='

fs= FileSystem.create('https://cottagesystems.com/~jbf/autoplot/tests/characters')
spec= ".*/.*"
ffs= fs.listDirectoryDeep( "/", spec );
for f in ffs:
    print f