com.knowgate.projtrack
Class DutyAttachment

java.lang.Object
  extended by com.knowgate.projtrack.DutyAttachment

public class DutyAttachment
extends java.lang.Object

Duty Attachment

This class represents objects stored as blobs at k_duties_attach table


Field Summary
static short ClassId
           
 
Constructor Summary
DutyAttachment()
          Default constructor
DutyAttachment(java.lang.String sIdDuty, java.lang.String sNameFile, int iSizeFile)
          Constructor
 
Method Summary
static void createFromFile(JDCConnection oConn, java.lang.String sDutyId, java.lang.String sFilePath)
          Insert attachment into k_duties_attach table
 void delete(JDCConnection oConn)
          Remove attachment from k_duties_attach table
static void delete(JDCConnection oConn, java.lang.String sDutyId, java.lang.String sFileName)
          Remove attachment from k_dutys_attach table
 java.lang.String dutyId()
           
 java.lang.String fileName()
           
 byte[] getBytes(JDCConnection oConn)
          Get stored attachment as byte array
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ClassId

public static final short ClassId
See Also:
Constant Field Values
Constructor Detail

DutyAttachment

public DutyAttachment()
Default constructor


DutyAttachment

public DutyAttachment(java.lang.String sIdDuty,
                      java.lang.String sNameFile,
                      int iSizeFile)
Constructor

Parameters:
sIdDuty - String GUID of Duty
sNameFile - String File Name
iSizeFile - int File size in bytes
Method Detail

size

public int size()
Returns:
int File size in bytes

fileName

public java.lang.String fileName()
Returns:
String File Name

dutyId

public java.lang.String dutyId()
Returns:
String Duty GUID

getBytes

public byte[] getBytes(JDCConnection oConn)
                throws java.sql.SQLException,
                       java.io.IOException
Get stored attachment as byte array

Parameters:
oConn - JDCConnection
Returns:
byte[]
Throws:
java.sql.SQLException
java.io.IOException

delete

public void delete(JDCConnection oConn)
            throws java.sql.SQLException
Remove attachment from k_duties_attach table

Parameters:
oConn - JDCConnection
Throws:
java.sql.SQLException

delete

public static void delete(JDCConnection oConn,
                          java.lang.String sDutyId,
                          java.lang.String sFileName)
                   throws java.sql.SQLException
Remove attachment from k_dutys_attach table

Parameters:
oConn - JDCConnection
sDutyId - String
sFileName - String
Throws:
java.sql.SQLException

createFromFile

public static void createFromFile(JDCConnection oConn,
                                  java.lang.String sDutyId,
                                  java.lang.String sFilePath)
                           throws java.sql.SQLException,
                                  java.io.FileNotFoundException,
                                  java.io.IOException,
                                  java.lang.NullPointerException
Insert attachment into k_duties_attach table

Parameters:
oConn - JDCConnection
sDutyId - String GUID of Duty to which attachment belongs
sFilePath - String Full path to local file
Throws:
java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException
java.lang.NullPointerException