删除索引文档
@param path /twitter/_doc/1
/twitter/_doc/1?routing=kimchy
/twitter/_doc/1?timeout=5m
@return
549242
public String deleteByPath(String path) throws ElasticSearchException{
		try{
			return this.client.executeHttp(path,ClientUtil.HTTP_DELETE);
		}
		catch(ElasticSearchException e){
			return ResultUtil.hand404HttpRuntimeException(e,String.class,ResultUtil.OPERTYPE_deleteDocument);
		}
	}
1243658
public URI toUri(JimfsPath path) {
    fileStore.state().checkOpen();
    return pathService.toUri(uri, path.toAbsolutePath());
  }
820034
private String read(String path) throws IOException {
        StringBuffer sb = new StringBuffer();
        String tempStr;
        File file = new File(path);
        // 如果文件不存在，读取失败
        if (!file.exists()) throw new FileNotFoundException();
        FileInputStream fis = new FileInputStream(file);
        BufferedReader br = new BufferedReader(new InputStreamReader(fis));
        while ((tempStr = br.readLine()) != null) sb.append(tempStr);
        return sb.toString();
    }
542193
public boolean load(String path)
    {
        trie = new DoubleArrayTrie<V>();
        long start = System.currentTimeMillis();
        if (loadDat(ByteArray.createByteArray(path + BIN_EXT)))
        {
            return true;
        }
        TreeMap<String, V> map = new TreeMap<String, V>();
        try
        {
            BufferedReader br = new BufferedReader(new InputStreamReader(IOUtil.newInputStream(path), "UTF-8"));
            String line;
            while ((line = br.readLine()) != null)
            {
                String[] paramArray = line.split("\\s");
                map.put(paramArray[0], createValue(paramArray));
            }
            br.close();
        }
        catch (Exception e)
        {
            logger.warning("读取" + path + "失败" + e);
            return false;
        }
        onLoaded(map);
        Set<Map.Entry<String, V>> entrySet = map.entrySet();
        List<String> keyList = new ArrayList<String>(entrySet.size());
        List<V> valueList = new ArrayList<V>(entrySet.size());
        for (Map.Entry<String, V> entry : entrySet)
        {
            keyList.add(entry.getKey());
            valueList.add(entry.getValue());
        }
        int resultCode = trie.build(keyList, valueList);
        if (resultCode != 0)
        {
            logger.warning("trie建立失败");
            return false;
        }
        logger.info(path + "加载成功，耗时" + (System.currentTimeMillis() - start) + "ms");
        saveDat(path + BIN_EXT, valueList);
        return true;
    }
653891
public static BufferedWriter newBufferedWriter(Path path) throws IOException {
        FileUtils.checkDirectory(path.getParent());
        BufferedWriter bufferedWriter;
        if (path.toFile().getName().endsWith(".gz")) {
            bufferedWriter = new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(path.toFile()))));
        } else {
            bufferedWriter = Files.newBufferedWriter(path, Charset.defaultCharset());
        }
        return bufferedWriter;
    }
558875
public static LinkedList<String> readLineListWithLessMemory(String path)
    {
        LinkedList<String> result = new LinkedList<String>();
        String line = null;
        boolean first = true;
        try
        {
            BufferedReader bw = new BufferedReader(new InputStreamReader(IOUtil.newInputStream(path), "UTF-8"));
            while ((line = bw.readLine()) != null)
            {
                if (first)
                {
                    first = false;
                    if (!line.isEmpty() && line.charAt(0) == '\uFEFF')
                        line = line.substring(1);
                }
                result.add(line);
            }
            bw.close();
        }
        catch (Exception e)
        {
            logger.warning("加载" + path + "失败，" + e);
        }

        return result;
    }
1166632
public static ArrayList<File> getFilesInDirectoryTree(String path) {
		File directory = new File(path);
		return getContentsInDirectoryTree(directory, "*", true, false);
	}
864509
private String getStringResource(String path) {
    	InputStream in = getClass().getResourceAsStream(path);
    	
    	StringBuilder index = new StringBuilder();
    	char[] buffer = new char[1024];
    	int read = 0;
    	try(InputStreamReader reader = new InputStreamReader(in)){
    		while((read = reader.read(buffer)) != -1) {
    			index.append(buffer, 0, read);
    		}
    	} catch (IOException e) {
    		//just return what we've got
    		return index.toString();
    	}
    	return index.toString();
    }
368013
public static BufferedWriter asBufferedWriter(Path path) throws IOException {
		Validate.notNull(path, "path is null");
		return Files.newBufferedWriter(path, Charsets.UTF_8);
	}
298890
public static List<File> fileList(String path)
    {
        List<File> fileList = new LinkedList<File>();
        File folder = new File(path);
        if (folder.isDirectory())
            enumerate(folder, fileList);
        else
            fileList.add(folder); // 兼容路径为文件的情况
        return fileList;
    }
888576
public JSON readFromFile( String path ) {
      return readFromStream( Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream( path ) );
   }
621580
public String getDownloadFileUrl(final Path path) {
        final StringBuilder sb = new StringBuilder(GWT.getModuleBaseURL() + EXPORT_SERVLET_URL);
        sb.append("?").append("path").append("=").append(URL.encode(path.toURI()));
        return sb.toString();
    }
127857
public boolean saveNGramToTxt(String path)
    {
        try
        {
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(IOUtil.newOutputStream(path)));
            for (Map.Entry<String, Integer> entry : trie.entrySet())
            {
                bw.write(entry.getKey() + " " + entry.getValue());
                bw.newLine();
            }
            bw.close();
        }
        catch (Exception e)
        {
            logger.warning("在保存NGram词典到" + path + "时发生异常" + e);
            return false;
        }

        return true;
    }
232618
public static String readResource(String path) {
        final long start = System.nanoTime();
        try (InputStream is = UScale.class.getClassLoader().getResourceAsStream(path);) {
            int len = 0;
            byte[] buffer = new byte[2048];
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            while ((len = is.read(buffer)) >= 0) {
                baos.write(buffer, 0, len);
            }
            return new String(baos.toByteArray(), StandardCharsets.UTF_8);
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, e, () -> "IOException loading resource " + path);
            throw new IllegalStateException("Unable to read class loaded stream " + path, e);
        } catch (RuntimeException re) {
            LOGGER.log(Level.WARNING, re, () -> "Unexpected exception loading resource " + path);
            throw re;
        } finally {
            LOGGER.fine(() -> String.format("Loaded resource %s in %.3fms", path,
                    (System.nanoTime() - start) / 1000000.0));
        }
    }
496239
public static byte[] hashPath(MessageDigest messageDigest, Path path) throws IOException {
        try (InputStream in = getRecursiveContentStream(path)) {
            return hashContent(messageDigest, in);
        }
    }
552707
private String readFile(String path) {

        String result = (String)CmsVfsMemoryObjectCache.getVfsMemoryObjectCache().getCachedObject(m_cms, path);
        if (result == null) {
            try {
                CmsFile file = m_cms.readFile(path);
                result = getContentAsString(file);
            } catch (CmsException e) {
                throw new RuntimeException(e);
            }
        }
        if (result != null) {
            CmsVfsMemoryObjectCache.getVfsMemoryObjectCache().putCachedObject(m_cms, path, result);
        }
        return result;

    }
128945
public static List<String> tokenize_path(String path) {
        String[] toks = path.split(SEPERATOR);
        ArrayList<String> rtn = new ArrayList<String>();
        for (String str : toks) {
            if (!str.isEmpty()) {
                rtn.add(str);
            }
        }
        return rtn;
    }