public void start(BundleContext context) throws Exception { ObjectInputOutputStreamFactoryFactory.setFactory( new OSGiObjectInputOutputStreamFactoryImpl(context)); }
@Override protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { Class clazz = OSGiObjectInputOutputStreamFactoryImpl.this.resolveClass(this, desc); if (clazz == null) { clazz = super.resolveClass(desc); } return clazz; }
@Override protected void annotateClass(Class<?> cl) throws IOException { OSGiObjectInputOutputStreamFactoryImpl.this.annotateClass(this, cl); } }
/** * Return Http Header Value after suitable validation * * @param headerValue Header Value which should be validated before being set * @return String Header Value sanitized for CRLF attack */ public static String getSafeHeaderValue(String headerValue) throws Exception { headerValue = removeLinearWhiteSpaces(headerValue); if (validateStringforCRLF(headerValue)) { throw new Exception("Header Value invalid characters"); } return headerValue; }
GlassFishObjectInputStream(Collection<GlassFishInputStreamHandler> handlers, InputStream in, ClassLoader appCl, boolean resolve) throws IOException, StreamCorruptedException { super(in); appLoader = appCl; this.handlers = handlers; if (resolve) { enableResolveObject(resolve); } inputStreamHelper = ObjectInputOutputStreamFactoryFactory.getFactory(); }
public ObjectOutputStream createObjectOutputStream(OutputStream out) throws IOException { return new OSGiObjectOutputStream(out); }
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return new ObjectInputStreamWithLoader(in, loader); }
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return new OSGiObjectInputStream(in, loader); }
public JavaEEObjectInputStream(InputStream ois, ClassLoader loader, boolean resolveObject, Collection<JavaEEObjectStreamHandler> handlers) throws IOException { super(ois, loader); super.enableResolveObject(resolveObject); this.handlers = handlers; }
@Override protected void annotateClass(Class<?> cl) throws IOException { outputStreamHelper.annotateClass(this, cl); }
/** * Return Http Header Name after suitable validation * * @param headerName Header Name which should be validated before being set * @return String Header Name sanitized for CRLF attack */ public static String getSafeHeaderName(String headerName) throws Exception { headerName = removeLinearWhiteSpaces(headerName); if (validateStringforCRLF(headerName)) { throw new Exception("Header Name invalid characters"); } return headerName; }
public void start(BundleContext context) throws Exception { ObjectInputOutputStreamFactoryFactory.setFactory( new OSGiObjectInputOutputStreamFactoryImpl(context)); }
@Override protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { Class clazz = OSGiObjectInputOutputStreamFactoryImpl.this.resolveClass(this, desc); if (clazz == null) { clazz = super.resolveClass(desc); } return clazz; }
GlassFishObjectOutputStream(Collection<GlassFishOutputStreamHandler> handlers, OutputStream out, boolean replaceObject) throws IOException { super(out); this.handlers = handlers; if (replaceObject == true) { enableReplaceObject(replaceObject); } outputStreamHelper = ObjectInputOutputStreamFactoryFactory.getFactory(); }
@Override protected void annotateClass(Class<?> cl) throws IOException { OSGiObjectInputOutputStreamFactoryImpl.this.annotateClass(this, cl); } }
public ObjectOutputStream createObjectOutputStream(OutputStream out) throws IOException { return new OSGiObjectOutputStream(out); }
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return new ObjectInputStreamWithLoader(in, loader); }
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return new OSGiObjectInputStream(in, loader); }
/** * Return Http Header Value after suitable validation * * @param headerValue Header Value which should be validated before being set * @return String Header Value sanitized for CRLF attack */ public static String getSafeHeaderValue(String headerValue) throws Exception { headerValue = removeLinearWhiteSpaces(headerValue); if (validateStringforCRLF(headerValue)) { throw new Exception("Header Value invalid characters"); } return headerValue; }
/** * Return Cookie Http Header Value after suitable validation * * @param headerValue Header Value which should be validated before being set * @return String Header Value sanitized for CRLF attack */ public static String getSafeCookieHeaderValue(String headerValue) throws Exception { headerValue = removeLinearWhiteSpaces(headerValue); if (validateStringforCRLF(headerValue)) { throw new Exception (" Cookie Header Value has invalid characters"); } return headerValue; } }