/** * Converts a GeoTools name to the syntax used by the specified JNDI context. This method is * similar to {@link #fixName(String)}, but uses the specified context instead of the GeoTools * one. * * @param context The context to use, or {@code null} if none. * @param name Name of the form {@code "jdbc:EPSG"}, or {@code null}. * @return Name fixed up with {@link Context#composeName(String,String)}, or {@code null} if the * given name was null. * @since 2.4 */ public static String fixName(final Context context, final String name) { return (context != null) ? fixName(context, name, null) : name; }
/** * Converts a GeoTools name to the syntax used by the {@linkplain #getInitialContext GeoTools * JNDI context}. Names may be constructed in a variety of ways depending on the implementation * of {@link InitialContext}. GeoTools uses {@code "jdbc:EPSG"} internally, but many * implementaitons use the form {@code "jdbc/EPSG"}. Calling this method before use will set the * name right. * * @param name Name of the form {@code "jdbc:EPSG"}, or {@code null}. * @return Name fixed up with {@link Context#composeName(String,String)}, or {@code null} if the * given name was null. * @since 2.4 */ public static String fixName(final String name) { return fixName(null, name, null); }