|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkr.co.hit.live.util.SystemHelper
public class SystemHelper
System 관련 Live Framework의 Helper Class
아래 Method들은 모두 static으로 선언 되었기 때문에 유념하기 바란다.
| Field Summary | |
|---|---|
static String |
SYSTEM_SPACE
|
static String |
URL_SPACE
|
| Method Summary | |
|---|---|
static ClassLoader |
getClassLoader()
Thread의 getContextClassLoader를 이용하여 ClassLoader을 리턴
|
static String |
getHostname()
|
static String |
getHostname(String defName)
|
static String |
getPackagePath(Class<?> clazz)
주어진 클래스의 package 구조를 경로 형태로 반환한다. |
static String |
getPackagePath(Object obj)
주어진 객체의 package 구조를 경로 형태로 반환한다. |
static File |
getResourceAsFile(ClassLoader loader,
String name)
Classpath 상의 Resource를 File으로 리턴한다. |
static File |
getResourceAsFile(String name)
Classpath 상의 Resource를 File으로 리턴한다. |
static Properties |
getResourceAsProperties(ClassLoader loader,
String name)
Classpath 상의 Resource를 Properties으로 리턴한다. |
static Properties |
getResourceAsProperties(String name)
Classpath 상의 Resource를 Properties으로 리턴한다. |
static Reader |
getResourceAsReader(ClassLoader loader,
String name)
Classpath 상의 Resource를 Reader으로 리턴한다. |
static Reader |
getResourceAsReader(String name)
Classpath 상의 Resource를 Reader으로 리턴한다. |
static InputStream |
getResourceAsStream(ClassLoader loader,
String name)
Classpath 상의 Resource를 InputStream으로 리턴한다. |
static InputStream |
getResourceAsStream(String name)
Classpath 상의 Resource를 InputStream으로 리턴한다. |
static File[] |
getResourcesAsFile(ClassLoader loader,
String name)
Classpath 상의 Resource들을 File의 배열으로 리턴한다. |
static File[] |
getResourcesAsFile(String name)
Classpath 상의 Resource들을 File의 배열으로 리턴한다. |
static URL |
getResourceURL(ClassLoader loader,
String name)
Classpath 상의 Resource를 URL으로 리턴한다. |
static URL |
getResourceURL(String name)
Classpath 상의 Resource를 URL으로 리턴한다. |
static Enumeration<URL> |
getResourceURLs(ClassLoader loader,
String name)
Classpath 상의 Resource들을 URL으로 리턴한다. |
static Enumeration<URL> |
getResourceURLs(String name)
Classpath 상의 Resource들을 URL으로 리턴한다. |
static String |
getSystemProperty(String key)
System의 getProperty Method의 LiveFramework의 Helper Method
|
static String |
getSystemProperty(String key,
String defaultValue)
System의 getProperty Method의 LiveFramework의 Helper Method
|
static Properties |
getUrlAsProperties(String urlString)
URL을 Properties으로 리턴한다. |
static Reader |
getUrlAsReader(String urlString)
URL을 Reader으로 리턴한다. |
static InputStream |
getUrlAsStream(String urlString)
URL을 InputStream으로 리턴한다. |
static String |
setSystemProperty(String key,
String value)
System의 setProperty Method의 LiveFramework의 Helper Method
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String URL_SPACE
public static final String SYSTEM_SPACE
| Method Detail |
|---|
public static String getSystemProperty(String key,
String defaultValue)
System의 getProperty Method의 LiveFramework의 Helper Method
key - SystemProperty의 정의된 keydefaultValue - SystemProperty의 정의된 key에 해당하는 value가 없는 경우 default값
public static String setSystemProperty(String key,
String value)
System의 setProperty Method의 LiveFramework의 Helper Method
key - System Property로 정의할 keyvalue - System Property로 정의할 value
public static String getSystemProperty(String key)
System의 getProperty Method의 LiveFramework의 Helper Method
key - SystemProperty의 정의된 key
public static InputStream getResourceAsStream(String name)
throws IOException
Classpath 상의 Resource를 InputStream으로 리턴한다.
name - 찾기위한 Resource
InputStream
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static InputStream getResourceAsStream(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource를 InputStream으로 리턴한다.
loader - Resource을 찾기 위한 ClassLoadername - 찾기위한 Resource
InputStream
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static URL getResourceURL(String name)
throws IOException
Classpath 상의 Resource를 URL으로 리턴한다.
name - 찾기위한 Resource
URL
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static Enumeration<URL> getResourceURLs(String name)
throws IOException
Classpath 상의 Resource들을 URL으로 리턴한다.
name - 찾기위한 Resource
URL을 Enumeration 으로 반환
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static URL getResourceURL(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource를 URL으로 리턴한다.
loader - Resource을 찾기 위한 ClassLoadername - 찾기위한 Resource
URL
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static Enumeration<URL> getResourceURLs(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource들을 URL으로 리턴한다.
loader - Resource을 찾기 위한 ClassLoadername - 찾기위한 Resource
URL을 Enumeration 으로 반환
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static Properties getResourceAsProperties(String name)
throws IOException
Classpath 상의 Resource를 Properties으로 리턴한다.
name - 찾기위한 Resource
Properties
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static Properties getResourceAsProperties(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource를 Properties으로 리턴한다.
loader - Resource을 찾기 위한 ClassLoadername - 찾기위한 Resource
Properties
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static Reader getResourceAsReader(String name)
throws IOException
Classpath 상의 Resource를 Reader으로 리턴한다.
name - 찾기위한 Resource
Reader
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static Reader getResourceAsReader(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource를 Reader으로 리턴한다.
loader - Resource을 찾기 위한 ClassLoadername - 찾기위한 Resource
Reader
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static File getResourceAsFile(String name)
throws IOException
Classpath 상의 Resource를 File으로 리턴한다.
내부적으로 URL 경로를 가져오는 구조이므로 resource 명에 공백이 있을 경우 %20 으로 치환되며
이 경우에는 실제 파일 경로와 달라지므로 해당 파일을 찾을 수 없게 된다.
따라서 resource 명에 공백이 포함되지 않도록 한다.
name - 찾기위한 Resource
File
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static File[] getResourcesAsFile(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource들을 File의 배열으로 리턴한다.
name - 찾기위한 Resource 이름
File의 배열
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static File[] getResourcesAsFile(String name)
throws IOException
Classpath 상의 Resource들을 File의 배열으로 리턴한다.
name - 찾기위한 Resource 이름
File의 배열
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static File getResourceAsFile(ClassLoader loader,
String name)
throws IOException
Classpath 상의 Resource를 File으로 리턴한다.
loader - Resource을 찾기 위한 ClassLoadername - 찾기위한 Resource
File
IOException - Resource를 찾을 수 없거나 읽을 수 경우
public static InputStream getUrlAsStream(String urlString)
throws IOException
URL을 InputStream으로 리턴한다.
urlString - - 가져오고자 하는 URL
InputStream
IOException - URL을 찾을 수 없거나 읽을 수 경우
public static Reader getUrlAsReader(String urlString)
throws IOException
URL을 Reader으로 리턴한다.
urlString - - 가져오고자 하는 URL
Reader
IOException - URL을 찾을 수 없거나 읽을 수 경우
public static Properties getUrlAsProperties(String urlString)
throws IOException
URL을 Properties으로 리턴한다.
urlString - - 가져오고자 하는 URL
Properties
IOException - URL을 찾을 수 없거나 읽을 수 경우public static String getPackagePath(Object obj)
obj -
public static String getPackagePath(Class<?> clazz)
clazz -
public static ClassLoader getClassLoader()
Thread의 getContextClassLoader를 이용하여 ClassLoader을 리턴
public static String getHostname()
public static String getHostname(String defName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||