com.sap.netweaver.coll.attachment

Class AttachmentUtil

java.lang.Object
  extended by com.sap.netweaver.coll.attachment.AttachmentUtil

public class AttachmentUtil
extends Object


Constructor Summary
AttachmentUtil()
           
 
Method Summary
static IRelation checkAttachmentRelation(IResource res)
          checks existence of Relation "attachment-of"
static IRelation checkAttachmentRelation(IResourceContext context, String sourceId)
          checks existence of Relation "attachment-of"
static void checkPath(IResourceContext context, String repPath, String tmpPath)
           
static String createAttachmentID()
          create a new ID of to be used by the Attachment Relation
static IRelation createAttachmentRelation(IResourceContext context, String sourceId, String path)
          creates Relation "attachment-of"
static IRelation createAttachmentRelation(IResource res, String path)
          creates Relation "attachment-of"
static ICollection getAttachmentCollection(IResource res)
          returns target-Collection of Relation "attachment-of" relation must exist
static ICollection getAttachmentCollection(IResourceContext context, String sourceId)
          returns target-ID of Relation "attachment-of" relation must exist
static IRelation getAttachmentSourceRelation(IResource resource)
          checks existence of Relation "attachment-of"
static String getAttachmentTargetID(IResource res)
          returns target-ID of Relation "attachment-of" relation must exist
static String getAttachmentTargetID(IResourceContext context, IRelation attachRelation)
          returns target-ID of Relation "attachment-of" relation must exist
static IRelation getAttachmentTargetRelation(IResource attachmentCollection)
          checks existence of Relation "attachment-of"
static PropertyDef getPropertyDef()
           
static PropertyName getPropertyNameCount()
           
static IResource getRelationSrcResource(IResource res)
           
static void setLifetime(IRelation rel, long lifetime)
          set Lifetime of Attachment Folder
static void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentUtil

public AttachmentUtil()
Method Detail

shutdown

public static void shutdown()

createAttachmentID

public static String createAttachmentID()
                                 throws Exception
create a new ID of to be used by the Attachment Relation

Returns:
String unique ID of an Attachment Relation
Throws:
Exception

setLifetime

public static void setLifetime(IRelation rel,
                               long lifetime)
                        throws Exception
set Lifetime of Attachment Folder

Parameters:
path - to storage of attachments
id - ID of Attachments
lifetime - in seconds
Throws:
Exception

getRelationSrcResource

public static IResource getRelationSrcResource(IResource res)

checkAttachmentRelation

public static IRelation checkAttachmentRelation(IResourceContext context,
                                                String sourceId)
                                         throws Exception
checks existence of Relation "attachment-of"

Parameters:
sourceId - source of Relation
context - ResourceContext, used by Relation-Service
Returns:
boolean true/false
Throws:
Exception

createAttachmentRelation

public static IRelation createAttachmentRelation(IResourceContext context,
                                                 String sourceId,
                                                 String path)
                                          throws Exception
creates Relation "attachment-of"

Parameters:
sourceId - source of Relation
context - ResourceContext, used by Relation-Service
path - where the Relation is stored
Returns:
ID which can be used to create Attachment Collection
Throws:
Exception

getAttachmentTargetID

public static String getAttachmentTargetID(IResourceContext context,
                                           IRelation attachRelation)
                                    throws Exception
returns target-ID of Relation "attachment-of" relation must exist

Parameters:
sourceId - source of Relation
context - ResourceContext, used by Relation-Service
path - where the Relation is stored
Returns:
ID which can be used to create Attachment Collection
Throws:
Exception

getAttachmentCollection

public static ICollection getAttachmentCollection(IResourceContext context,
                                                  String sourceId)
                                           throws Exception
returns target-ID of Relation "attachment-of" relation must exist

Parameters:
sourceId - source of Relation
context - ResourceContext, used by Relation-Service
path - where the Relation is stored
Returns:
ID which can be used to create Attachment Collection
Throws:
Exception

checkAttachmentRelation

public static IRelation checkAttachmentRelation(IResource res)
                                         throws Exception
checks existence of Relation "attachment-of"

Parameters:
res - source of Relation
Returns:
boolean true/false
Throws:
Exception

getAttachmentTargetRelation

public static IRelation getAttachmentTargetRelation(IResource attachmentCollection)
                                             throws Exception
checks existence of Relation "attachment-of"

Parameters:
res - ICollection where Attachments are stored
Returns:
boolean true/false
Throws:
Exception

getAttachmentSourceRelation

public static IRelation getAttachmentSourceRelation(IResource resource)
                                             throws Exception
checks existence of Relation "attachment-of"

Parameters:
res - ICollection where Attachments are stored
Returns:
boolean true/false
Throws:
Exception

createAttachmentRelation

public static IRelation createAttachmentRelation(IResource res,
                                                 String path)
                                          throws Exception
creates Relation "attachment-of"

Parameters:
res - source of Relation
path - where the Relation is stored
Returns:
ID which can be used to create Attachment Collection
Throws:
Exception

getAttachmentTargetID

public static String getAttachmentTargetID(IResource res)
                                    throws Exception
returns target-ID of Relation "attachment-of" relation must exist

Parameters:
res - source of Relation
path - where the Relation is stored
Returns:
ID which can be used to create Attachment Collection
Throws:
Exception

getAttachmentCollection

public static ICollection getAttachmentCollection(IResource res)
                                           throws Exception
returns target-Collection of Relation "attachment-of" relation must exist

Parameters:
res - source of Relation
path - where the Relation is stored
Returns:
ID which can be used to create Attachment Collection
Throws:
Exception

getPropertyNameCount

public static PropertyName getPropertyNameCount()

getPropertyDef

public static PropertyDef getPropertyDef()

checkPath

public static void checkPath(IResourceContext context,
                             String repPath,
                             String tmpPath)
                      throws NoAttachmentListException
Throws:
NoAttachmentListException


Copyright 2011 SAP AG Complete Copyright Notice