create a new core

@param path
@param type
@return created core
@throws IOException
429201
RamResourceCore createCore(String path, int type) throws IOException {
	String[] names = ListUtil.listToStringArray(path, '/');
	RamResourceCore rrc = root;
	for (int i = 0; i < names.length - 1; i++) {
	    rrc = rrc.getChild(names[i], caseSensitive);
	    if (rrc == null) throw new IOException("can't create resource " + path + ", missing parent resource");
	}
	rrc = new RamResourceCore(rrc, type, names[names.length - 1]);
	return rrc;
    }
486585
public static <T> T readObjectFromFile(String path, Class<T> type, JavaSparkContext sc) throws IOException {
        return readObjectFromFile(path, type, sc.sc());
    }
182154
public static RouteImpl create(final String path, String acceptType, final Route route) {
        if (acceptType == null) {
            acceptType = DEFAULT_ACCEPT_TYPE;
        }
        return new RouteImpl(path, acceptType, route) {
            @Override
            public Object handle(Request request, Response response) throws Exception {
                return route.handle(request, response);
            }
        };
    }
546591
static PathFileObject createJarPathFileObject(JavacPathFileManager fileManager,
            final Path path) {
        return new PathFileObject(fileManager, path) {
            @Override
            String inferBinaryName(Iterable<? extends Path> paths) {
                return toBinaryName(path);
            }
        };
    }
207952
public static <T> Path<T> path(Class<? extends T> type, String variable) {
        return new PathImpl<T>(type, variable);
    }
368013
public static BufferedWriter asBufferedWriter(Path path) throws IOException {
		Validate.notNull(path, "path is null");
		return Files.newBufferedWriter(path, Charsets.UTF_8);
	}
1256551
public static Typeface createFromFile(@Nullable String path) {
        Typeface typeface = TYPEFACES.get(path);
        if (typeface != null) {
            return typeface;
        } else {
            typeface = Typeface.createFromFile(path);
            TYPEFACES.put(path, typeface);
            return typeface;
        }
    }
991836
public static File openOrCreate(String path,String fileName) throws IOException {
        Path filePath = Paths.get(path, fileName);
        File file = filePath.toFile();
        if (file.exists()) {
            if (file.isFile()) {
                return file;
            }
            throw new FileNotFoundException(path+" is discroty");
        }else {
            mkirDirs(filePath.getParent());
            file.createNewFile();
            return file;
        }
    }
828644
public WritableByteChannel create(URI path) throws IOException {
    logger.atFine().log("create(%s)", path);
    return create(path, CreateFileOptions.DEFAULT);
  }
1297416
public static Resource create(@NotNull ResourceResolver resourceResolver, @Nullable String path, @NotNull String resourceType,
      @NotNull ValueMap valueMap) {
    return new GraniteUiSyntheticResource(resourceResolver,
        path,
        resourceType,
        valueMap,
        ImmutableList.<Resource>of());
  }
521577
public static DynamicClassLoader create(PathImpl path)
  {
    ClassLoader parent = Thread.currentThread().getContextClassLoader();

    return create(parent, path);
  }
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;
    }
479512
public static BufferedWriter newBufferedWriter(String path) throws IOException
    {
        return new BufferedWriter(new OutputStreamWriter(IOUtil.newOutputStream(path), "UTF-8"));
    }
1069134
public static <T> T readObjectFromFile(String path, Class<T> type, SparkContext sc) throws IOException {
        FileSystem fileSystem = FileSystem.get(sc.hadoopConfiguration());
        try (ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(fileSystem.open(new Path(path))))) {
            Object o;
            try {
                o = ois.readObject();
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }

            return (T) o;
        }
    }
421084
public final void addResource(String path, HtmlResourceType type) {
		resources.add(new HtmlResource(path, type));
	}
1310665
public static BufferedReader newBufferedReader(Path path, Charset charset) throws IOException {
        return new BufferedReader(new InputStreamReader(newInputStream(path), charset));
    }
160970
public static Intent newPlayMediaFileIntent(String path, String type) {
        return newPlayMediaIntent(Uri.fromFile(new File(path)), type);
    }