|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.util.IOUtils
public class IOUtils
| Constructor Summary | |
|---|---|
IOUtils()
|
|
| Method Summary | |
|---|---|
static void |
close(Closeable... closeableArray)
Tries to close the given objects and log the IOException at INFO level
to make the code more readable when we assume that the IOException won't be managed. |
static String |
getCleanedServletPath(String fullServletPath)
Used to remove trailing slash and wildcard from a servlet path. Examples : - "/foo/" becomes "/foo" - "foo/bar" becomes "/foo/bar" |
static String |
guestServletPath(AtmosphereConfig config)
|
static boolean |
isAtmosphere(String className)
|
static boolean |
isBodyBinary(AtmosphereRequest request)
|
static boolean |
isBodyEmpty(Object o)
|
static Class<?> |
loadClass(Class thisClass,
String className)
|
static Object |
readEntirely(AtmosphereResource r)
|
static byte[] |
readEntirelyAsByte(AtmosphereResource r)
|
static StringBuilder |
readEntirelyAsString(AtmosphereResource r)
|
static Map<String,AtmosphereFramework.MetaServiceAction> |
readServiceFile(String path)
This method reads the given file stored under "META-INF/services" and accessed through the framework's class loader to specify a list of actions to be done on different
service classes (AtmosphereInterceptor, BroadcastFilter, etc). |
static String |
realPath(javax.servlet.ServletContext servletContext,
String targetPath)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IOUtils()
| Method Detail |
|---|
public static Object readEntirely(AtmosphereResource r)
public static final boolean isBodyBinary(AtmosphereRequest request)
public static final boolean isBodyEmpty(Object o)
public static StringBuilder readEntirelyAsString(AtmosphereResource r)
public static byte[] readEntirelyAsByte(AtmosphereResource r)
public static String guestServletPath(AtmosphereConfig config)
public static String getCleanedServletPath(String fullServletPath)
fullServletPath - : Servlet mapping
public static Class<?> loadClass(Class thisClass,
String className)
throws Exception
Exceptionpublic static boolean isAtmosphere(String className)
public static Map<String,AtmosphereFramework.MetaServiceAction> readServiceFile(String path)
This method reads the given file stored under "META-INF/services" and accessed through the framework's class loader
to specify a list of actions to be done on different
service classes (AtmosphereInterceptor, BroadcastFilter, etc).
The file content should follows the following format:
INSTALL com.mycompany.MyInterceptor com.mycompany.MyFilter EXCLUDE org.atmosphere.interceptor.HeartbeatInterceptor
If you don't specify any AtmosphereFramework.MetaServiceAction before a class, then
default action will be AtmosphereFramework.MetaServiceAction.INSTALL.
Important note: you must specify a class declared inside a package. Since creating classes in the source root is a bad practice, the method does not deal with it to improve its performances.
path - the service file to read
public static void close(Closeable... closeableArray)
Tries to close the given objects and log the IOException at INFO level
to make the code more readable when we assume that the IOException won't be managed.
Also ignore null parameters.
closeableArray - the objects to close
public static String realPath(javax.servlet.ServletContext servletContext,
String targetPath)
throws MalformedURLException
MalformedURLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||