Create a web socket scope. Use the IWebSocketScopeListener interface to configure the created scope.

@param path
340566
public void makeScope(String path) {
        log.debug("makeScope: {}", path);
        WebSocketScope wsScope = null;
        if (!scopes.containsKey(path)) {
            // new websocket scope
            wsScope = new WebSocketScope();
            wsScope.setPath(path);
            notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
            addWebSocketScope(wsScope);
            log.debug("Use the IWebSocketScopeListener interface to be notified of new scopes");
        } else {
            log.debug("Scope already exists: {}", path);
        }
    }
628375
private static void fsyncLineage(final Path path) throws IOException {
        Path cursor = path.toRealPath();
        while (cursor != null) {
            fsync(cursor);
            cursor = cursor.getParent();
        }
    }
864834
@Override
    public void setPath ( String path ) {
        if ( path.length() > 0 && path.charAt(0) == '\\' ) {
            path = path.substring(1);
        }
        // win8.1 returns ACCESS_DENIED if the trailing backslash is included
        if ( path.length() > 1 && path.charAt(path.length() - 1) == '\\' ) {
            path = path.substring(0, path.length() - 1);
        }
        this.name = path;
    }
494926
public static WatchMonitor createAll(String path, Watcher watcher){
		return createAll(Paths.get(path), watcher);
	}
1140503
public static Runnable watch(Path path, PathEventListener listener) throws IOException {
		return watch(path, listener,
			StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);
	}
953129
public void setPath(String path) throws URIException {

        if (path == null || path.length() == 0) {
            _path = _opaque = (path == null) ? null : path.toCharArray();
            setURI();
            return;
        }
        // set the charset to do escape encoding
        String charset = getProtocolCharset();

        if (_is_net_path || _is_abs_path) {
            _path = encode(path, allowed_abs_path, charset);
        } else if (_is_rel_path) {
            StringBuffer buff = new StringBuffer(path.length());
            int at = path.indexOf('/');
            if (at == 0) { // never 0
                throw new URIException(URIException.PARSING,
                        "incorrect relative path");
            }
            if (at > 0) {
                buff.append(encode(path.substring(0, at), allowed_rel_path,
                            charset));
                buff.append(encode(path.substring(at), allowed_abs_path,
                            charset));
            } else {
                buff.append(encode(path, allowed_rel_path, charset));
            }
            _path = buff.toString().toCharArray();
        } else if (_is_opaque_part) {
            StringBuffer buf = new StringBuffer();
            buf.insert(0, encode(path.substring(0, 1), uric_no_slash, charset));
            buf.insert(1, encode(path.substring(1), uric, charset));
            _opaque = buf.toString().toCharArray();
        } else {
            throw new URIException(URIException.PARSING, "incorrect path");
        }
        setURI();
    }
214765
private void _watchNode(String path) throws ZooKeeperException {
        try {
            cacheNodeWatcher.get(path);
        } catch (Exception e) {
            if (e instanceof ZooKeeperException) {
                throw (ZooKeeperException) e;
            } else {
                throw new ZooKeeperException(e);
            }
        }
    }
1151909
static HttpStreamWrapper openReadWrite(HttpPath path) throws IOException
  {
    HttpStream stream = createStream(path);
    stream._isPost = true;

    return new HttpStreamWrapper(stream);
  }
1198410
public static InputStream getStream(String path) throws IOException {
    // the other ways to load the stream like
    // "Tools.class.getClass().getResourceAsStream(filename)"
    // don't work in a web context (using Grails):
    InputStream is = Tools.class.getResourceAsStream(path);
    if (is == null) {
      throw new IOException("Could not load file from classpath: '" + path + "'");
    }
    return is;
  }
720485
private static void createDirectory(Path path) throws IOException {
		try {
			Files.createDirectory(path);
		} catch (FileAlreadyExistsException e) {
			if (!Files.isDirectory(path)) {
				throw e;
			}
		}
	}
505478
SocketInterface createSocket(@NonNull final String token, @NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {

        WebSocket socket = null;

        WebSocketFactory factory = new WebSocketFactory();

        // Configure proxy if provided
        if (proxyAddress != null) {
            ProxySettings settings = factory.getProxySettings();
            settings.setServer(proxyAddress);
        }

        try {
            socket = factory.createSocket(uri, TIMEOUT);
        } catch (IOException e) {
            log.f("Creating socket failed", e);
        }

        if (socket != null) {

            String header = AuthManager.AUTH_PREFIX + token;
            socket.addHeader("Authorization", header);

            socket.addListener(createWebSocketAdapter(stateListenerWeakReference));

            socket.setPingInterval(PING_INTERVAL);

            return new SocketWrapperImpl(socket);
        }

        return null;
    }
551458
public static boolean canConnectUnixSocket(File path) {
        try (UnixSocketChannel channel = UnixSocketChannel.open()) {
            return channel.connect(new UnixSocketAddress(path));
        } catch (IOException e) {
            return false;
        }
    }
889845
protected void checkPath(Path path) {
    URI thisUri = this.getUri();
    URI thatUri = path.toUri();
    String thatAuthority = thatUri.getAuthority();
    if (thatUri.getScheme() != null
        && thatUri.getScheme().equalsIgnoreCase(thisUri.getScheme())
        && thatUri.getPort() == NameNode.DEFAULT_PORT
        && thisUri.getPort() == -1
        && thatAuthority.substring(0,thatAuthority.indexOf(":"))
        .equalsIgnoreCase(thisUri.getAuthority()))
      return;
    super.checkPath(path);
  }
1121960
public static InputStream newInputStream(String path) throws IOException
    {
        if (IOAdapter == null) return new FileInputStream(path);
        return IOAdapter.open(path);
    }
527728
public HttpMessage path(final String path) {
        header(HttpMessageHeaders.HTTP_REQUEST_URI, path);
        header(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, path);
        return this;
    }
1339729
public boolean connectUnixImpl(Path path)
    throws IOException
  {
    _socketTimeout = 600000;

    _nativeFd = -1;
    _isClosed.set(false);

    synchronized (_writeLock) {
      String nativePath = path.toRealPath().toString();
      
      boolean isConnect = nativeConnectUnix(_socketFd, nativePath);

      return isConnect;
    }
  }
1154611
protected InputStream getInputStream (String path)
        throws IOException
    {
        FileInputStream fis = new FileInputStream(path);
        return new BufferedInputStream(fis);
    }