Convert data content for all resources below the given path

@param converter content converter
@param path      sub path to convert data

@return builder
540341
public TreeBuilder<T> convert(ContentConverter<T> converter, Path path) {
        return convert(converter, PathUtil.subpathSelector(path));
    }
478549
@Override
    public void addConverter(Class<?> from, Class<?> to, Converter converter) {
        Map toMap = fromMap.get(from);
        if (toMap == null) {
            toMap = new HashMap<Class<?>, Map<Class<?>, Converter>>();
            fromMap.put(from, toMap);
        }
        toMap.put(to, converter);
    }
637092
public static OutputStreamResource outputStreamResource(final String path,
                                                            final SupplierWithThrowable<OutputStream, IOException> supplier) {
        return new OutputStreamResource(path, supplier);
    }
707019
async def convert_local(path, to_type):
    '''
    
    '''
    # Now find path between types
    typed_foreign_res = TypedLocalResource(path)
    original_ts = typed_foreign_res.typestring
    conversion_path = singletons.converter_graph.find_path(
        original_ts, to_type)
    # print('Conversion path: ', conversion_path)

    # Loop through each step in graph path and convert
    for is_first, is_last, path_step in first_last_iterator(conversion_path):
        converter_class, from_ts, to_ts = path_step
        converter = converter_class()
        in_resource = TypedLocalResource(path, from_ts)
        if is_first:  # Ensure first resource is just the source one
            in_resource = typed_foreign_res
        out_resource = TypedLocalResource(path, to_ts)

        if is_last:
            out_resource = TypedPathedLocalResource(path, to_ts)
        await converter.convert(in_resource, out_resource)
1257959
public void addConverter(Converter<?, ?> converter) {
		GenericConverter.ConvertiblePair typeInfo = getRequiredTypeInfo(converter, Converter.class);
		Assert.notNull(typeInfo, "Unable to the determine sourceType <S> and targetType " +
				"<T> which your Converter<S, T> converts between; declare these generic types.");
		addConverter(new ConverterAdapter(converter, typeInfo));
	}
921247
public Reader generateResource(String path, GeneratorContext context) {
	
		Locale locale = null == context.getLocale() ? Locale.getDefault()
				: context.getLocale();
		String validators = context.getPath();
		String validatorParams = context.getParenthesesParam();

		String messagesNS = MessageBundleScriptCreator.DEFAULT_NAMESPACE;
		boolean stopOnErrors = true;

		StringTokenizer valparams = new StringTokenizer(validatorParams, "|");
		String validatorMappingKey = valparams.nextToken();
		if (valparams.hasMoreTokens())
			messagesNS = valparams.nextToken();
		if (valparams.hasMoreTokens())
			stopOnErrors = Boolean.valueOf(valparams.nextToken())
					.booleanValue();

		// Build the ValidatorResources if it doesn't exist yet
		if (!validatorResourcesMap.containsKey(validatorMappingKey)) {
			createValidatorResources(validatorMappingKey, context.getConfig());
		}

		ValidatorResources validatorResources = (ValidatorResources) validatorResourcesMap
				.get(validatorMappingKey);
		StringBuffer sb = new StringBuffer();
		StringTokenizer tk = new StringTokenizer(validators, "|");
		while (tk.hasMoreTokens()) {
			String validator = tk.nextToken();
			if (STATIC_JAVASCRIPT_KEY.equals(validator)) {
				sb.append(buildStaticJavascript(validatorResources));
			} else
				sb.append(buildFormJavascript(validatorResources, validator,
						locale, messagesNS, stopOnErrors));

		}

		return new StringReader(sb.toString());
	}
1300801
public @Nonnull Optional<InputStream> getResourceAsStream(@Nonnull String path) {
        ArgumentUtils.requireNonNull("path", path);
        Optional<ResourceLoader> resourceLoader = getSupportingLoader(path);
        if (resourceLoader.isPresent()) {
            return resourceLoader.get().getResourceAsStream(path);
        }
        return Optional.empty();
    }
839186
public static org.apache.hadoop.fs.Path toHadoopPath(Path path) {
		return new org.apache.hadoop.fs.Path(path.toUri());
	}
1143588
@Override
    public InputStream getResourceAsStream( String path )
    {
        Object in = null;
        if ( null != baseLoader )
            // classloader wants no leading slash
            in = baseLoader.getResourceAsStream( path.substring(1) );
        if ( null == in )
            return super.getResourceAsStream( path );
        return (InputStream) in;
    }
962977
@Override
	public ResourceResolver getSupportingResolver(String path) {
		LOG.debug("Finding resolver for resource {}...", path);
		for (ResourceResolver resolver : resolvers) {
			if (resolver.supports(path)) {
				LOG.debug("{} can handle resource {}", resolver, path);
				return resolver;
			}
		}

		LOG.debug("No resolver can handle path '{}'", path);
		return null;
	}
328435
public @Nonnull Optional<URL> getResource(@Nonnull String path) {
        ArgumentUtils.requireNonNull("path", path);
        Optional<ResourceLoader> resourceLoader = getSupportingLoader(path);
        if (resourceLoader.isPresent()) {
            return resourceLoader.get().getResource(path);
        }
        return Optional.empty();
    }
1113878
public static BinaryAnnotationMappingDeriver getInstance(String path) {
        if (instance == null) {
            synchronized (LOCK) {
                if (instance == null) {
                    instance = path == null ? new BinaryAnnotationMappingDeriver() :
                            new BinaryAnnotationMappingDeriver(path);
                }
            }
        }

        return instance;
    }
1343361
@Override
	public Writer getResourceAsWriter(String path) throws IOException {
		try {
			return new OutputStreamWriter(getResourceAsOutputStream(path), charset);
		} catch (UnsupportedEncodingException e) {
			// Should not happen as we're checking the charset in constructor
			throw new BundlingProcessException(e);
		}
	}
223135
public TreeBuilder<T> convert(ContentConverter<T> converter) {
        return TreeBuilder.<T>builder(new ConverterTree<T>(build(), converter, PathUtil.allpathSelector()));
    }
1347754
@SuppressWarnings("unchecked") public <R, W> Converter<R, W> getConverter(String key) {
        return (Converter<R, W>) converts.get(key);
    }
680504
public static OutputStream newOutputStream(String path) throws IOException
    {
        if (IOAdapter == null) return new FileOutputStream(path);
        return IOAdapter.create(path);
    }
1225815
@Trivial
    public static <K> UserConverter<K> newInstance(Converter<K> converter) {
        return newInstance(getType(converter), converter);
    }