Convenience method which ensures the given path exists, wrapping any {@link AlluxioException}
in {@link IOException}.

@param path the path to look up
181637
private void ensureExists(AlluxioURI path) throws IOException {
    try {
      mFileSystem.getStatus(path);
    } catch (AlluxioException e) {
      throw new IOException(e);
    }
  }
754001
public void loadPath(String path, String suffix)
			throws IOException {
		List<File> files = MyFiles.getAllFiles(path, suffix);
		for(File f:files){
			load(f.toString());
		}
		
	}
852170
protected String findClasspathFile(final String path) throws IOException {
        if (path == null){
            return null;
        }
        final File file = new File(path);
        if (file.exists()){
            return file.getAbsolutePath();
        }
        return createTmpFile(path).getAbsolutePath();
    }
1084930
public void addFile(String path, File file) throws IOException {
    addFile(path, file, null);
  }
886289
public AbstractIntegerAssert<?> jsonPathAsInteger(String path) {
        return Assertions.assertThat(actual.read(path, Integer.class));
    }
47485
@Override
  public FileStatus getFileStatus(Path path) throws IOException {
    LOG.debug("getFileStatus({})", path);

    if (mStatistics != null) {
      mStatistics.incrementReadOps(1);
    }
    AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path));
    URIStatus fileStatus;
    try {
      fileStatus = mFileSystem.getStatus(uri);
    } catch (FileDoesNotExistException e) {
      throw new FileNotFoundException(e.getMessage());
    } catch (AlluxioException e) {
      throw new IOException(e);
    }

    return new FileStatus(fileStatus.getLength(), fileStatus.isFolder(),
        getReplica(fileStatus), fileStatus.getBlockSizeBytes(),
        fileStatus.getLastModificationTimeMs(),
        fileStatus.getCreationTimeMs(), new FsPermission((short) fileStatus.getMode()),
        fileStatus.getOwner(), fileStatus.getGroup(), new Path(mAlluxioHeader + uri));
  }
237294
List<AlluxioURI> checkConsistency(AlluxioURI path, CheckConsistencyPOptions options)
      throws IOException {
    FileSystemMasterClient client = mFsContext.acquireMasterClient();
    try {
      return client.checkConsistency(path, options);
    } finally {
      mFsContext.releaseMasterClient(client);
    }
  }
1059200
@Override
	public Set<InputStream> getResourcesAsStream(final String path) throws IOException
	{
		// First, try the path as specified
		final Set<InputStream> streams = inner.getResourcesAsStream(path);

		// If no results were found and the path was absolute, retry without the leading slash
		if ((streams == null || streams.isEmpty()) && !path.isEmpty() && path.charAt(0) == '/')
		{
			// Strip the leading slash away and re-try the path
			// This lets us
			final String newPath = path.substring(1);

			return inner.getResourcesAsStream(newPath);
		}
		else
		{
			return streams;
		}
	}
201683
public boolean hasPath(String path) {
        Props props = pathMap.get(path);
        return props != null && !props.isEmpty();
    }
86446
@Override
  public boolean resourceExists(String path) {
    String completePath = getCompleteResourceUrl(path);
    return ResourceDataBroker.class.getResource(completePath) != null;
  }
163913
public static File ensureDir(String path, String name) throws IOException {
		if((path == null) || (path.length() == 0)) {
			throw new IOException("No configuration for (" + name + ")");
		}
		File dir = new File(path);
		if(dir.exists()) {
			if(!dir.isDirectory()) {
				throw new IOException("Dir(" + name + ") at (" + path + 
						") exists but is not a directory!");
			}
		} else {
			if(!dir.mkdirs()) {
				throw new IOException("Unable to create dir(" + name +") at ("
						+ path + ")");
			}
		}
		return dir;
	}
667794
public void setPath( String path )
    {
        // Note that an empty path is OK
        if ( path == null )
        {
            _path = null;
            setQuery( null );
            setFragment( null );
        }
        else
        {
            _path = path;
            _opaque = false;
            setSchemeSpecificPart( null );
        }
    }
720485
private static void createDirectory(Path path) throws IOException {
		try {
			Files.createDirectory(path);
		} catch (FileAlreadyExistsException e) {
			if (!Files.isDirectory(path)) {
				throw e;
			}
		}
	}
170924
public boolean exist(String path) {
		final String fileName = FileUtil.getName(path);
		final String dir = StrUtil.removeSuffix(path, fileName);
		final List<String> names = ls(dir);
		return containsIgnoreCase(names, fileName);
	}
907199
public void redirect(String path) throws IOException
    {
        //response.setHeader("Location", path.charAt(0)=='/' ? path : "/"+path);
        response.sendRedirect(path.charAt(0)=='/' ? path : "/"+path);
        output.close();
    }
1268876
private void createDirAndFile(Path path) throws IOException {
			// create dir and file first if dir/file not exist
			File file = new File(path.toAbsolutePath().toString());
			File dir = file.getParentFile();
			if (dir != null && !dir.exists()) {
				dir.mkdirs();
			}
			if (!file.exists()) {
				file.createNewFile();
			}
	}
555770
public Exists exists(String path) {
        Exists command = new Exists();
        command.path(path);
        action.setCommand(command);
        return command;
    }