将自己序列化到

@param path
@return
161467
public boolean serializeTo(String path)
    {
        ObjectOutputStream out = null;
        try
        {
            out = new ObjectOutputStream(IOUtil.newOutputStream(path));
            out.writeObject(this);
        }
        catch (Exception e)
        {
//            e.printStackTrace();
            return false;
        }
        return true;
    }
864261
static boolean loadDat(String path)
    {
        try
        {
            ByteArray byteArray = ByteArray.createByteArray(path + Predefine.BIN_EXT);
            if (byteArray == null) return false;
            int size = byteArray.nextInt();
            CoreDictionary.Attribute[] attributes = new CoreDictionary.Attribute[size];
            final Nature[] natureIndexArray = Nature.values();
            for (int i = 0; i < size; ++i)
            {
                // 第一个是全部频次，第二个是词性个数
                int currentTotalFrequency = byteArray.nextInt();
                int length = byteArray.nextInt();
                attributes[i] = new CoreDictionary.Attribute(length);
                attributes[i].totalFrequency = currentTotalFrequency;
                for (int j = 0; j < length; ++j)
                {
                    attributes[i].nature[j] = natureIndexArray[byteArray.nextInt()];
                    attributes[i].frequency[j] = byteArray.nextInt();
                }
            }
            if (!trie.load(byteArray, attributes) || byteArray.hasMore()) return false;
        }
        catch (Exception e)
        {
            logger.warning("读取失败，问题发生在" + e);
            return false;
        }
        return true;
    }
459952
public Object match(String path)
    {
        Map.Entry entry = getMatch(path);
        if (entry!=null)
            return entry.getValue();
        return null;
    }
1182301
public final ActionMethod getActionMethod(String path) {
		// 不带参数的请求
		ActionMethod actionMethod = this.get(path);
		if (null != actionMethod) {
			return actionMethod;
		}
		
		// 带参数的请求
		final int lastSlashIndex = path.lastIndexOf(StrUtil.SLASH);
		if (lastSlashIndex != -1) {
			actionMethod = this.get(path.substring(0, lastSlashIndex));
			if (actionMethod != null) {
				Request.splitAndSetParams(path.substring(lastSlashIndex + 1));
			}
		}

		return actionMethod;
	}
1252109
public Stream<URL> getResources(String path) {
        Enumeration<URL> all;
        try {
            all = classLoader.getResources(prefixPath(path));
        } catch (IOException e) {
            return Stream.empty();
        }
        Stream.Builder<URL> builder = Stream.builder();
        while (all.hasMoreElements()) {
            URL url = all.nextElement();
            builder.accept(url);
        }
        return builder.build();
    }
271872
private static String fileAsString(String path) throws Exception {
        StringBuffer buffer = new StringBuffer();
        InputStream fis = new FileInputStream(path);
        InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
        Reader in = new BufferedReader(isr);
        int ch;
        while ((ch = in.read()) > -1) {
            buffer.append((char) ch);
        }
        in.close();
        return buffer.toString();
    }
929745
public List<Vertex> parsePath(int[] path)
    {
        List<Vertex> vertexList = new LinkedList<Vertex>();
        for (int i : path)
        {
            vertexList.add(vertexes[i]);
        }

        return vertexList;
    }
688411
public static List<String> readUtf8Lines(String path) throws IORuntimeException {
		return readLines(path, CharsetUtil.CHARSET_UTF_8);
	}
818101
public GetData get(String path) {
        GetData command = new GetData();
        command.path(path);
        action.setCommand(command);
        return command;
    }
982617
static List<MethodParameter> extract(String path) {

		List<MethodParameter> output = new ArrayList<>();

		List<String> items = split(path);

		if (items.size() > 0) {

			int pathIndex = 0;
			int index = 0;
			for (String item : items) {

				MethodParameter param = getParamFromPath(item, index, pathIndex); // set negative index until confirmed that needed

				if (param != null) {
					output.add(param);
					index++;
				}

				pathIndex++;
			}
		}

		return output;
	}
888576
public JSON readFromFile( String path ) {
      return readFromStream( Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream( path ) );
   }
1011417
public static List<String> get(String name, @Nullable Path path) {
    return Args.path(name, path);
  }
179834
public static InputStream getResourceStream(final String path) {
		final ClassLoader loader = Resources.class.getClassLoader();
		return loader.getResourceAsStream(path);
	}
303153
private static List<String> load(String path) {
        List<String> result = new ArrayList<>();
        try{
            InputStream in = null;
            LOGGER.info("加载资源："+path);
            if(path.startsWith("classpath:")){
                in = AutoDetector.class.getClassLoader().getResourceAsStream(path.replace("classpath:", ""));
            }else{
                in = new FileInputStream(path);
            }
            try(BufferedReader reader = new BufferedReader(new InputStreamReader(in,"utf-8"))){
                String line;
                while((line = reader.readLine()) != null){
                    line = line.trim();
                    if("".equals(line) || line.startsWith("#")){
                        continue;
                    }
                    result.add(line);
                }
            }
        }catch(Exception e){
            LOGGER.error("加载资源失败："+path, e);
        }
        return result;
    }
212843
public static String getClassName(String path) {
        for (Pattern pattern : patterns) {
            Matcher m = pattern.matcher(path);
            if (m.find()) {
                return m.group(1).replaceAll("[/\\\\]", ".");
            }
        }
        return null;
    }
1242862
public static String getScript(String path) {
        StringBuilder sb = new StringBuilder();

        InputStream stream = ScriptUtil.class.getClassLoader().getResourceAsStream(path);
        try (BufferedReader br = new BufferedReader(new InputStreamReader(stream))){

            String str;
            while ((str = br.readLine()) != null) {
                sb.append(str).append(System.lineSeparator());
            }

        } catch (IOException e) {
            System.err.println(e.getStackTrace());
        }
        return sb.toString();
    }
1166632
public static ArrayList<File> getFilesInDirectoryTree(String path) {
		File directory = new File(path);
		return getContentsInDirectoryTree(directory, "*", true, false);
	}