if ((clients != null) && (clients.size() > 0))
{
Iterator _it = clients.iterator();
while (_it.hasNext())
{
JSClient _c = (JSClient) _it.next();
// create a new Media
try
{
Client client = caps.createClient(_c.getName());
/**
* THE KEY_OVERWRITE_EXISTING test IS required for media
* types, since they carry no other information than the
* name Used here for consistency, though
*/
if ((isSettingSet(settings, JetspeedSerializer.KEY_OVERWRITE_EXISTING))
|| (client.getClientId() == 0))
{
// set object fields
client.setUserAgentPattern(_c.getUserAgentPattern());
client.setManufacturer(_c.getManufacturer());
client.setModel(_c.getModel());
client.setEvalOrder(_c.getEvalOrder());
String myPrefMimeType = _c.getPreferredMimeTypeID();
client.setVersion(_c.getVersion());
try
{
_line = _c.getMimeTypesString().toString();
List<String> list = getTokens(_line);
if ((list != null) && (list.size() > 0))
{
Iterator<String> _it1 = list.iterator();
int added = 0;
while (_it1.hasNext())
{
MimeType _mt = caps.createMimeType((String) _it1.next());
if (_mt != null)
{
client.getMimetypes().add(_mt);
if (_mt.getMimetypeId() == 0)
{
caps.storeMimeType(_mt);
}
if (myPrefMimeType.equalsIgnoreCase(_mt.getName()))
client.setPreferredMimeTypeId(_mt.getMimetypeId());
}
added++;
}
}
}
catch (Exception e1)
{
e1.printStackTrace();
}
try
{
_line = _c.getCapabilitiesString().toString();
List<String> list = getTokens(_line);
if ((list != null) && (list.size() > 0))
{
Iterator<String> _it1 = list.iterator();
if ((list != null) && (list.size() > 0))