title: How can I convert a concrete directory path to NSURL?
body: <p>I'd like to know how could I create a URL from a path String.
  Here my code:</p>
  
  <pre><code>    let completePath = "/Volumes/MyNetworkFolder/"
  
      do {
          let items = try FileManager.default.contentsOfDirectory(atPath: completePath)
  
          for item in items {
              if item.hasDirectoryPath { //String has no member hasDirectoryPath
                  itemList.append(item)
              }
          }
      } catch {
          print("Failed to read dir")
          let buttonPushed = dialogOKCancel(question: "Failed to read dir", text: "Map the network folder")
          if(buttonPushed) {
              exit(0)
          }
      }
  </code></pre>
  
  <p>I'd like to add only folders to the itemList array. The hasDirectoryPath is an URL method.
  How could i change my code to get URLs not String.</p>
  
  <p>Thank you in advance for any help you can provide.</p>