Forum Discussion

Soumic_Mohanty's avatar
Soumic_Mohanty
New Contributor II
3 years ago

java.io.FileNotFoundException:

Hi All,

I am trying to read using “Directory Browser” snap.However I am getting the below error message.
Directory Browser1[630c7b8c5e736915c210eda5_49364b8a-16de-4c13-9770-a89f98340a00 – f339566b-122c-442c-b45c-d6aacd414817]
`com.snaplogic.snap.api.SnapDataException: Error browsing the directory contents.
at com.snaplogic.snaps.binary.DirectoryBrowser.process(DirectoryBrowser.java:380)
at com.snaplogic.snap.api.ExecutionUtil.process(ExecutionUtil.java:106)
at com.snaplogic.snap.api.ExecutionUtil.execute(ExecutionUtil.java:70)
at com.snaplogic.snap.api.SimpleSnap.execute(SimpleSnap.java:70)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.executeSnap(SnapRunnableImpl.java:809)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.executeForSuggest(SnapRunnableImpl.java:648)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:865)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:436)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:120)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.nio.file.NoSuchFileException: D:\Secure Parking Local Drive\ Day 30 - Manual Import - 20230130\20230130
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsDirectoryStream.(WindowsDirectoryStream.java:86)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:523)
at java.base/java.nio.file.Files.newDirectoryStream(Files.java:604)
at com.snaplogic.snaps.binary.DirectoryBrowser.getAttributes(DirectoryBrowser.java:587)
at com.snaplogic.snaps.binary.DirectoryBrowser.lambda$displayAttributes$0(DirectoryBrowser.java:541)
at net.jodah.failsafe.Functions$11.call(Functions.java:263)
at net.jodah.failsafe.SyncFailsafe.call(SyncFailsafe.java:145)
at net.jodah.failsafe.SyncFailsafe.get(SyncFailsafe.java:69)
at com.snaplogic.snaps.binary.BinaryUtils.failsafeExecute(BinaryUtils.java:490)
at com.snaplogic.snaps.binary.DirectoryBrowser.displayAttributes(DirectoryBrowser.java:546)
at com.snaplogic.snaps.binary.DirectoryBrowser.process(DirectoryBrowser.java:365)
… 14 more
Reason: D:\Secure Parking Local Drive\ Day 30 - Manual Import - 20230130\20230130
Resolution: Please try again.

Error Fingerprint[0] = efp:com.snaplogic.snaps.binary.FXNHxIgp
Error Fingerprint[1] = efp:sun.nio.fs.jzu7jEGn`

1 Reply

  • Hi @Sahil ,

    Which value are you expecting to be null ? With your current condition it will only check if …BEL is not empty and if any value before it is null it will fail.

    You can either try this with the .get() method. You can also try with Data Validator snap to check if a value is not present or if it is empty.

    • clinton_hemmant's avatar
      clinton_hemmant
      New Contributor III

      Must use minLength and Constraint value = 1

      Required does not work for null.  Pattern = null does not work

  • endor_force's avatar
    endor_force
    New Contributor III

    Null values should be possible to identify in expressions in most places.

    The following condition would check that BEL is not blank or null, split them up if you need to handle them separately in the router. 

    $ZSDATA.IDOC.EDL2.EDL4.BEL != "" && $ZSDATA.IDOC.EDL2.EDL4.BEL != null

    If you need to do the opposite to catch if an element is null or blank you simply change the conditions:

    $ZSDATA.IDOC.EDL2.EDL4.BEL == "" || $ZSDATA.IDOC.EDL2.EDL4.BEL == null


    If you have scenarios where you can be missing the element completely you may have to also throw in a check first that the object exists at all.
    If you are having null safe access in a mapper where you map BEL, it would make this redundant.

    $ZSDATA.IDOC.EDL2.EDL4.hasPath("BEL")