mirror of
https://github.com/Dansen999/migor.git
synced 2026-01-11 05:24:16 +00:00
Initial import (partially)
This commit is contained in:
@@ -13,28 +13,28 @@
|
||||
<artifactId>org.migor.core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-jaxrs</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-jaxrs</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-validator</groupId>
|
||||
<artifactId>commons-validator</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-validator</groupId>
|
||||
<artifactId>commons-validator</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.migor.server</groupId>
|
||||
<artifactId>org.migor.shared</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<groupId>org.migor.server</groupId>
|
||||
<artifactId>org.migor.shared</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -25,11 +25,11 @@ public class BeanUtils {
|
||||
* This method does NOT work on interfaces.
|
||||
*
|
||||
* @param instanceClass the bean class.
|
||||
* @param <T> generic type of the bean.
|
||||
* @param <T> generic type of the bean.
|
||||
* @return injected bean.
|
||||
* @throws javax.naming.NamingException if lookup for the BeanManager fails
|
||||
*/
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T get(@NotNull final Class<T> instanceClass) throws NamingException {
|
||||
BeanManager beanManager = getBeanManager();
|
||||
|
||||
@@ -38,13 +38,12 @@ public class BeanUtils {
|
||||
CreationalContext<Object> context = beanManager.createCreationalContext(null);
|
||||
Object instance = injectionTarget.produce(context);
|
||||
injectionTarget.inject(instance, context);
|
||||
injectionTarget.postConstruct( instance );
|
||||
injectionTarget.postConstruct(instance);
|
||||
|
||||
return (T) instance;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return BeanManager
|
||||
* @throws javax.naming.NamingException
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.zip.GZIPOutputStream;
|
||||
|
||||
/**
|
||||
* The type Zip utils.
|
||||
*
|
||||
* @author Daniel Scheidle
|
||||
* daniel.scheidle@ucs.at
|
||||
* Unique Computing Solutions GmbH
|
||||
@@ -34,8 +35,7 @@ public class ZipUtils {
|
||||
outputStream = new ByteArrayOutputStream();
|
||||
compress(inputStream, outputStream);
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
throw new Exception(e.getMessage(), e);
|
||||
} finally {
|
||||
if (outputStream != null) outputStream.close();
|
||||
@@ -60,8 +60,7 @@ public class ZipUtils {
|
||||
outputStream = new ByteArrayOutputStream();
|
||||
decompress(inputStream, outputStream);
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
throw new Exception(e.getMessage(), e);
|
||||
} finally {
|
||||
if (outputStream != null) outputStream.close();
|
||||
@@ -73,7 +72,7 @@ public class ZipUtils {
|
||||
/**
|
||||
* Compress void.
|
||||
*
|
||||
* @param inputStream the input stream
|
||||
* @param inputStream the input stream
|
||||
* @param outputStream the output stream
|
||||
* @throws java.io.IOException the iO exception
|
||||
*/
|
||||
@@ -98,7 +97,7 @@ public class ZipUtils {
|
||||
/**
|
||||
* Decompress void.
|
||||
*
|
||||
* @param inputStream the input stream
|
||||
* @param inputStream the input stream
|
||||
* @param outputStream the output stream
|
||||
* @throws java.io.IOException the iO exception
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user