Package io.jans.scim.util
Class ServiceUtil
- java.lang.Object
-
- io.jans.scim.util.ServiceUtil
-
- All Implemented Interfaces:
Serializable
@ApplicationScoped public class ServiceUtil extends Object implements Serializable
User: Dejan Maric- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteGroupFromPerson(GluuGroup group, String dn)
Delete a Group from a Personstatic com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
void
groupMembersAdder(GluuCustomPerson gluuPerson, String dn)
Adds a person to a groupString
iterableToString(Iterable<?> list)
void
personMembersAdder(GluuGroup gluuGroup, String dn)
Adds a group to a person's memberOfstatic byte[]
readFully(InputStream is)
Read all bytes from the supplied input stream.static String
saveRandomFile(byte[] array, String baseDir, String extension)
Save file with random name with provided base directory and extension.
-
-
-
Method Detail
-
deleteGroupFromPerson
public void deleteGroupFromPerson(GluuGroup group, String dn) throws Exception
Delete a Group from a Person- Throws:
Exception
-
personMembersAdder
public void personMembersAdder(GluuGroup gluuGroup, String dn) throws Exception
Adds a group to a person's memberOf- Throws:
Exception
-
groupMembersAdder
public void groupMembersAdder(GluuCustomPerson gluuPerson, String dn) throws Exception
Adds a person to a group- Throws:
Exception
-
saveRandomFile
public static String saveRandomFile(byte[] array, String baseDir, String extension) throws IOException
Save file with random name with provided base directory and extension.- Parameters:
array
- binary content of file.baseDir
- Write to directory.extension
- Filename extension.- Returns:
- Return full path
- Throws:
IOException
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
readFully
public static byte[] readFully(InputStream is) throws IOException
Read all bytes from the supplied input stream. Closes the input stream.- Parameters:
is
- Input stream- Returns:
- All bytes
- Throws:
IOException
- If an I/O problem occurs
-
-