Package org.apache.felix.gogo.command
Class Util
- java.lang.Object
-
- org.apache.felix.gogo.command.Util
-
public class Util extends Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancompareSubstring(List<String> pieces, String s)static voidcopy(InputStream is, File dir, String destName, String destDir, byte[] buffer)static voiddownloadSource(PrintStream out, PrintStream err, URL srcURL, File localDir, boolean extract)static StringgetBundleName(org.osgi.framework.Bundle bundle)static <T> TgetService(org.osgi.framework.BundleContext bc, Class<T> clazz, List<org.osgi.framework.ServiceReference<?>> refs)static StringgetUnderlineString(int len)static StringgetValueString(Object obj)static InputStreamopenURL(URL url)static InputStreamopenURL(URLConnection conn)static List<String>parseSubstring(String value)static StringresolveUri(org.apache.felix.service.command.CommandSession session, String relativeUri)Intepret a string as a URI relative to the current working directory.static voidsetProxyAuth(URLConnection conn)static voidungetServices(org.osgi.framework.BundleContext bc, List<org.osgi.framework.ServiceReference<?>> refs)static voidunjar(JarInputStream jis, File dir)static StringunparseSubstring(List<String> pieces)
-
-
-
Method Detail
-
getBundleName
public static String getBundleName(org.osgi.framework.Bundle bundle)
-
getUnderlineString
public static String getUnderlineString(int len)
-
getService
public static <T> T getService(org.osgi.framework.BundleContext bc, Class<T> clazz, List<org.osgi.framework.ServiceReference<?>> refs)
-
ungetServices
public static void ungetServices(org.osgi.framework.BundleContext bc, List<org.osgi.framework.ServiceReference<?>> refs)
-
downloadSource
public static void downloadSource(PrintStream out, PrintStream err, URL srcURL, File localDir, boolean extract)
-
unjar
public static void unjar(JarInputStream jis, File dir) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream is, File dir, String destName, String destDir, byte[] buffer) throws IOException
- Throws:
IOException
-
setProxyAuth
public static void setProxyAuth(URLConnection conn) throws IOException
- Throws:
IOException
-
openURL
public static InputStream openURL(URL url) throws IOException
- Throws:
IOException
-
openURL
public static InputStream openURL(URLConnection conn) throws IOException
- Throws:
IOException
-
resolveUri
public static String resolveUri(org.apache.felix.service.command.CommandSession session, String relativeUri) throws IOException
Intepret a string as a URI relative to the current working directory.- Parameters:
session- the session (where the CWD is stored)relativeUri- the input URI- Returns:
- the resulting URI as a string
- Throws:
IOException
-
-