Sample 0 [from 122 instances]

Class420.setPath(final URI initialUri,final String path)#0{
            if (initialUri.getHost() == null && initialUri.getAuthority() != null) {
                return new URI(initialUri.getScheme(), initialUri.getAuthority(), finalPath, initialUri.getQuery(),
                        initialUri.getFragment());
            else {
                return new URI(initialUri.getScheme(), initialUri.getUserInfo(), initialUri.getHost(), initialUri.getPort(),
                        finalPath, initialUri.getQuery(), initialUri.getFragment());
            }
}


Sample 1 [from 117 instances]

Class340.valideUri(URI uri)#0{
    String schemeSpecificPart = uri.getSchemeSpecificPart();
    if (schemeSpecificPart.isEmpty()) {
      throw new IllegalArgumentException("scheme specific part must not be empty");
    }
    String host = uri.getHost();
    if (host != null) {
      throw new IllegalArgumentException("host must not be set");
    }
    String authority = uri.getAuthority();
    if (authority != null) {
      throw new IllegalArgumentException("authority must not be set");
    }
    String userInfo = uri.getUserInfo();
    if (userInfo != null) {
      throw new IllegalArgumentException("userInfo must not be set");
    }
    int port = uri.getPort();
    if (port != -1) {
      throw new IllegalArgumentException("port must not be set");
    }
    String path = uri.getPath();
    if (path != null) {
      throw new IllegalArgumentException("path must not be set");
    }
    String query = uri.getQuery();
    if (query != null) {
      throw new IllegalArgumentException("query must not be set");
    }
    String fragment = uri.getFragment();
    if (fragment != null) {
      throw new IllegalArgumentException("fragment must not be set");
    }
}


Sample 2 [from 93 instances]

Class440.uriSubpath(URI uri,String subpath)#2{
    String path = uri.getPath();
    if (path != null && path.length() 0)
    {
      subpath = path + "/" + subpath; //$NON-NLS-1$
    }
    if (uri.getScheme() != null && subpath.charAt(0!= '/')
    {
      subpath = "/" + subpath; //$NON-NLS-1$
    }
      return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), subpath, uri.getQuery(),
          uri.getFragment());
}


Sample 3 [from 62 instances]

Class80.moveLocalFiles(Configuration conf)#4{
          if (null != uri.getFragment() && DistributedCache.getSymlink(conf)) {

            FileUtil.symLink(uri.getPath(), uri.getFragment());
            files.append(uri.getFragment()).append(",");
          }
          FileSystem hdfs = FileSystem.get(conf);
}


Sample 4 [from 19 instances]

Class90.removeServer(URI uri){
            return new URI(null, null, null, -1, uri.getPath(), uri.getQuery(), uri.getFragment());
            throw new InvalidUriException(e);
}


Sample 5 [from 6 instances]

Class380.copyAndConfigureFiles(JobConf job,Path submitJobDir,short replication)#1{
        Path tmp = new Path(tmpURI);
        Path newPath = copyRemoteFiles(fs,filesDir, tmp, job, replication);
          URI pathURI = getPathURI(newPath, tmpURI.getFragment());
          DistributedCache.addCacheFile(pathURI, job);
          throw new IOException("Failed to create uri for " + tmpFile, ue);
}