Java Code Examples for org.apache.pdfbox.cos.COSString

The following examples show how to use org.apache.pdfbox.cos.COSString. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: geoportal-server-harvester   Source File: PdfUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns a datum string for the projection.
 * 
 * @param datumObj the "Datum" property in the GeoPDF's projection dictionary
 * 
 * @returns the datum string. If it can't determine the appropriate string, defaults to WGS 84.
 */
private static String datumTranslation(COSBase datumObj) {

    if (datumObj instanceof COSString) {
        String datumKey = ((COSString) datumObj).getString();

        if (datumKey.startsWith("NAS")) {
            return "GEOGCS[\"GCS_North_American_1927\",DATUM[\"D_North_American_1927\",SPHEROID[\"Clarke_1866\",6378206.4,294.9786982]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
        } else if (datumKey.startsWith("WG") || datumKey.equals("WE")) {
            return "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
        }

        // TODO Add more datum keys, from the GeoPDF specification
    } 

    LOG.warn("Assuming WGS84 for GeoPDF datum...");
    return "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
}
 
Example 2
Source Project: gcs   Source File: PDIndexed.java    License: Mozilla Public License 2.0 6 votes vote down vote up
private byte[] getLookupData() throws IOException
{
    if (lookupData == null)
    {
        COSBase lookupTable = array.getObject(3);
        if (lookupTable instanceof COSString)
        {
            lookupData = ((COSString) lookupTable).getBytes();
        }
        else if (lookupTable instanceof COSStream)
        {
            lookupData = new PDStream((COSStream)lookupTable).toByteArray();
        }
        else if (lookupTable == null)
        {
            lookupData = new byte[0];
        }
        else
        {
            throw new IOException("Error: Unknown type for lookup table " + lookupTable);
        }
    }
    return lookupData;
}
 
Example 3
Source Project: gcs   Source File: SecurityHandler.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will decrypt a string.
 *
 * @param string the string to decrypt.
 * @param objNum The object number.
 * @param genNum The object generation number.
 *
 * @throws IOException If an error occurs writing the new string.
 */
private void decryptString(COSString string, long objNum, long genNum) throws IOException
{
	// String encrypted with identity filter
	if (COSName.IDENTITY.equals(stringFilterName))
	{
        return;
	}
	
    ByteArrayInputStream data = new ByteArrayInputStream(string.getBytes());
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    try
    {
        encryptData(objNum, genNum, data, outputStream, true /* decrypt */);
        string.setValue(outputStream.toByteArray());
    }
    catch (IOException ex)
    {
        LOG.error("Failed to decrypt COSString of length " + string.getBytes().length + 
                " in object " + objNum + ": " + ex.getMessage());
    }
}
 
Example 4
Source Project: gcs   Source File: FDFJavaScript.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will get the javascript that is executed before the import.
 *
 * @return Some javascript code.
 */
public String getBefore()
{
    COSBase base = dictionary.getDictionaryObject(COSName.BEFORE);
    if (base instanceof COSString)
    {
        return ((COSString) base).getString();
    }
    else if (base instanceof COSStream)
    {
        return ((COSStream) base).toTextString();
    }
    else
    {
        return null;
    }
}
 
Example 5
Source Project: gcs   Source File: FDFJavaScript.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will get the javascript that is executed after the import.
 *
 * @return Some javascript code.
 */
public String getAfter()
{
    COSBase base = dictionary.getDictionaryObject(COSName.AFTER);
    if (base instanceof COSString)
    {
        return ((COSString) base).getString();
    }
    else if (base instanceof COSStream)
    {
        return ((COSStream) base).toTextString();
    }
    else
    {
        return null;
    }
}
 
Example 6
Source Project: gcs   Source File: FDFField.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * Returns the COS value of this field.
 * 
 * @return The COS value of the field.
 * @throws IOException If there is an error getting the value.
 */
public COSBase getCOSValue() throws IOException
{
    COSBase value = field.getDictionaryObject(COSName.V);
    
    if (value instanceof COSName)
    {
        return value;
    }
    else if (value instanceof COSArray)
    {
        return value;
    }
    else if (value instanceof COSString || value instanceof COSStream)
    {
        return value;
    }
    else if (value != null)
    {
        throw new IOException("Error:Unknown type for field import" + value);
    }
    else
    {
        return null;
    }
}
 
Example 7
Source Project: gcs   Source File: FDFField.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will set the rich text that is associated with this field.
 *
 * @return The rich text XHTML stream.
 */
public String getRichText()
{
    COSBase rv = field.getDictionaryObject(COSName.RV);
    if (rv == null)
    {
        return null;
    }
    else if (rv instanceof COSString)
    {
        return ((COSString) rv).getString();
    }
    else
    {
        return ((COSStream) rv).toTextString();
    }
}
 
Example 8
Source Project: gcs   Source File: FDFAnnotation.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * Get a text or text stream.
 *
 * Some dictionary entries allow either a text or a text stream.
 *
 * @param base the potential text or text stream
 * @return the text stream
 */
protected final String getStringOrStream(COSBase base)
{
    if (base == null)
    {
        return "";
    }
    else if (base instanceof COSString)
    {
        return ((COSString) base).getString();
    }
    else if (base instanceof COSStream)
    {
        return ((COSStream) base).toTextString();
    }
    else
    {
        return "";
    }
}
 
Example 9
Source Project: gcs   Source File: PDNameTreeNode.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will return a map of names on this level. The key will be a string,
 * and the value will depend on where this class is being used.
 *
 * @return ordered map of COS objects or <code>null</code> if the dictionary
 * contains no 'Names' entry on this level.
 *
 * @throws IOException If there is an error while creating the sub types.
 * @see #getKids()
 */
public Map<String, T> getNames() throws IOException
{
    COSArray namesArray = (COSArray)node.getDictionaryObject( COSName.NAMES );
    if( namesArray != null )
    {
        Map<String, T> names = new LinkedHashMap<String, T>();
        for( int i=0; i<namesArray.size(); i+=2 )
        {
            COSString key = (COSString)namesArray.getObject(i);
            COSBase cosValue = namesArray.getObject( i+1 );
            names.put( key.getString(), convertCOSToPD(cosValue) );
        }
        return Collections.unmodifiableMap(names);
    }
    else
    {
        return null;
    }
}
 
Example 10
Source Project: gcs   Source File: PDNameTreeNode.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * Set the names for this node. This method will set the appropriate upper and lower limits
 * based on the keys in the map.
 *
 * @param names map of names to objects, or <code>null</code> for nothing.
 */
public void setNames( Map<String, T> names )
{
    if( names == null )
    {
        node.setItem( COSName.NAMES, (COSObjectable)null );
        node.setItem( COSName.LIMITS, (COSObjectable)null);
    }
    else
    {
        COSArray array = new COSArray();
        List<String> keys = new ArrayList<String>(names.keySet());
        Collections.sort(keys);
        for (String key : keys) 
        {
            array.add(new COSString(key));
            array.add(names.get(key));
        }
        node.setItem(COSName.NAMES, array);
        calculateLimits();
    }
}
 
Example 11
Source Project: gcs   Source File: COSArrayList.java    License: Mozilla Public License 2.0 6 votes vote down vote up
private List<COSBase> toCOSObjectList( Collection<?> list )
{
    List<COSBase> cosObjects = new ArrayList<COSBase>();
    for (Object next : list)
    {
        if( next instanceof String )
        {
            cosObjects.add( new COSString( (String)next ) );
        }
        else
        {
            COSObjectable cos = (COSObjectable)next;
            cosObjects.add( cos.getCOSObject() );
        }
    }
    return cosObjects;
}
 
Example 12
Source Project: gcs   Source File: COSArrayList.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void add(int index, E element)
{
    //when adding if there is a parentDict then change the item
    //in the dictionary from a single item to an array.
    if( parentDict != null )
    {
        parentDict.setItem( dictKey, array );
        //clear the parent dict so it doesn't happen again, there might be
        //a usecase for keeping the parentDict around but not now.
        parentDict = null;
    }
    actual.add( index, element );
    if( element instanceof String )
    {
        array.add( index, new COSString( (String)element ) );
    }
    else
    {
        array.add( index, ((COSObjectable)element).getCOSObject() );
    }
}
 
Example 13
Source Project: gcs   Source File: PDVariableText.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * Get a text as text stream.
 *
 * Some dictionary entries allow either a text or a text stream.
 *
 * @param base the potential text or text stream
 * @return the text stream
 */
protected final String getStringOrStream(COSBase base)
{
    if (base == null)
    {
        return "";
    }
    else if (base instanceof COSString)
    {
        return ((COSString)base).getString();
    }
    else if (base instanceof COSStream)
    {
        return ((COSStream)base).toTextString();
    }
    else
    {
        return "";
    }
}
 
Example 14
Source Project: gcs   Source File: PDDefaultAppearanceString.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * Constructor for reading an existing DA string.
 * 
 * @param defaultResources DR entry
 * @param defaultAppearance DA entry
 * @throws IOException If the DA could not be parsed
 */
PDDefaultAppearanceString(COSString defaultAppearance, PDResources defaultResources) throws IOException
{
    if (defaultAppearance == null)
    {
        throw new IllegalArgumentException("/DA is a required entry");
    }
    
    if (defaultResources == null)
    {
        throw new IllegalArgumentException("/DR is a required entry");
    }
    
    this.defaultResources = defaultResources;
    processAppearanceStringOperators(defaultAppearance.getBytes());
}
 
Example 15
Source Project: gcs   Source File: PDSignature.java    License: Mozilla Public License 2.0 6 votes vote down vote up
private byte[] getConvertedContents(InputStream is) throws IOException
{
    ByteArrayOutputStream byteOS = new ByteArrayOutputStream(1024);
    byte[] buffer = new byte[1024];
    int c;
    while ((c = is.read(buffer)) != -1)
    {
        // Filter < and (
        if(buffer[0]==0x3C || buffer[0]==0x28)
        {
            byteOS.write(buffer, 1, c);
        }
        // Filter > and )
        else if(buffer[c-1]==0x3E || buffer[c-1]==0x29)
        {
            byteOS.write(buffer, 0, c-1);
        }
        else
        {
            byteOS.write(buffer, 0, c);
        }
    }
    is.close();

    return COSString.parseHex(byteOS.toString("ISO-8859-1")).getBytes();
}
 
Example 16
Source Project: gcs   Source File: PDAnnotationMarkup.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will retrieve the rich text stream which is displayed in the popup window.
 *
 * @return the rich text stream.
 */
public String getRichContents()
{
    COSBase base = getCOSObject().getDictionaryObject(COSName.RC);
    if (base instanceof COSString)
    {
        return ((COSString) base).getString();
    }
    else if (base instanceof COSStream)
    {
        return ((COSStream) base).toTextString();
    }
    else
    {
        return null;
    }
}
 
Example 17
Source Project: gcs   Source File: PDActionURI.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * This will get the uniform resource identifier to resolve. It should be encoded in 7-bit
 * ASCII, but UTF-8 and UTF-16 are supported too.
 *
 * @return The URI entry of the specific URI action dictionary or null if there isn't any.
 */
public String getURI()
{
    COSBase base = action.getDictionaryObject(COSName.URI);
    if (base instanceof COSString)
    {
        byte[] bytes = ((COSString) base).getBytes();
        if (bytes.length >= 2)
        {
            // UTF-16 (BE)
            if ((bytes[0] & 0xFF) == 0xFE && (bytes[1] & 0xFF) == 0xFF)
            {
                return action.getString(COSName.URI);
            }
            // UTF-16 (LE)
            if ((bytes[0] & 0xFF) == 0xFF && (bytes[1] & 0xFF) == 0xFE)
            {
                return action.getString(COSName.URI);
            }
        }
        return new String(bytes, Charsets.UTF_8);
    }
    return null;
}
 
Example 18
Source Project: gcs   Source File: PDSeedValueCertificate.java    License: Mozilla Public License 2.0 6 votes vote down vote up
/**
 * Returns list of key usages of certificate strings where each string is 9 characters long and each character is
 * one of these values {0, 1, X} 0 for must not set, 1 for must set, X for don't care. each index in the string
 * represents a key usage:
 * <ol>
 * <li>digitalSignature</li>
 * <li>non-Repudiation</li>
 * <li>keyEncipherment</li>
 * <li>dataEncipherment</li>
 * <li>keyAgreement</li>
 * <li>keyCertSign</li>
 * <li>cRLSign</li>
 * <li>encipherOnly</li>
 * <li>decipherOnly</li>
 * </ol>
 * 
 * @return list of key usages
 */
public List<String> getKeyUsage()
{
    COSBase base = this.dictionary.getDictionaryObject(COSName.KEY_USAGE);
    if (base instanceof COSArray)
    {
        COSArray array = (COSArray) base;
        List<String> keyUsageExtensions = new LinkedList<String>();
        for (COSBase item : array)
        {
            if (item instanceof COSString)
            {
                keyUsageExtensions.add(((COSString) item).getString());
            }
        }
        return keyUsageExtensions;
    }
    return null;
}
 
Example 19
Source Project: gcs   Source File: PDSeedValueCertificate.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * removes a subject from the list
 *
 * @param subject byte array containing DER-encoded X.509v3 certificate
 */
public void removeSubject(byte[] subject)
{
    COSBase base = this.dictionary.getDictionaryObject(COSName.SUBJECT);
    if (base instanceof COSArray)
    {
        COSArray array = (COSArray) base;
        array.remove(new COSString(subject));
    }
}
 
Example 20
Source Project: gcs   Source File: SecurityHandler.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will dispatch to the correct method.
 *
 * @param obj The object to decrypt.
 * @param objNum The object number.
 * @param genNum The object generation Number.
 *
 * @throws IOException If there is an error getting the stream data.
 */
public void decrypt(COSBase obj, long objNum, long genNum) throws IOException
{
    if (!(obj instanceof COSString || obj instanceof COSDictionary || obj instanceof COSArray))
    {
        return;
    }
    // PDFBOX-4477: only cache strings and streams, this improves speed and memory footprint
    if (obj instanceof COSString)
    {
        if (objects.contains(obj))
        {
            return;
        }
        objects.add(obj);
        decryptString((COSString) obj, objNum, genNum);
    }
    else if (obj instanceof COSStream)
    {
        if (objects.contains(obj))
        {
            return;
        }
        objects.add(obj);
        decryptStream((COSStream) obj, objNum, genNum);
    }
    else if (obj instanceof COSDictionary)
    {
        decryptDictionary((COSDictionary) obj, objNum, genNum);
    }
    else if (obj instanceof COSArray)
    {
        decryptArray((COSArray) obj, objNum, genNum);
    }
}
 
Example 21
Source Project: gcs   Source File: SecurityHandler.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will decrypt a dictionary.
 *
 * @param dictionary The dictionary to decrypt.
 * @param objNum The object number.
 * @param genNum The object generation number.
 *
 * @throws IOException If there is an error creating a new string.
 */
private void decryptDictionary(COSDictionary dictionary, long objNum, long genNum) throws IOException
{
    if (dictionary.getItem(COSName.CF) != null)
    {
        // PDFBOX-2936: avoid orphan /CF dictionaries found in US govt "I-" files
        return;
    }
    COSBase type = dictionary.getDictionaryObject(COSName.TYPE);
    boolean isSignature = COSName.SIG.equals(type) || COSName.DOC_TIME_STAMP.equals(type) ||
            // PDFBOX-4466: /Type is optional, see
            // https://ec.europa.eu/cefdigital/tracker/browse/DSS-1538
            (dictionary.getDictionaryObject(COSName.CONTENTS) instanceof COSString && 
             dictionary.getDictionaryObject(COSName.BYTERANGE) instanceof COSArray);
    for (Map.Entry<COSName, COSBase> entry : dictionary.entrySet())
    {
        if (isSignature && COSName.CONTENTS.equals(entry.getKey()))
        {
            // do not decrypt the signature contents string
            continue;
        }
        COSBase value = entry.getValue();
        // within a dictionary only the following kind of COS objects have to be decrypted
        if (value instanceof COSString || value instanceof COSArray || value instanceof COSDictionary)
        {
            decrypt(value, objNum, genNum);
        }
    }
}
 
Example 22
Source Project: gcs   Source File: PDSeedValueCertificate.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * (Optional) A list of byte arrays containing DER-encoded X.509v3 certificates that are
 * acceptable for signing. if
 * <b>Subject</b> is not null and {@link #isSubjectRequired()} is true then the subject
 * constraint is enforced on the subjects in this array subjects.
 *
 * @param subjects list of byte arrays containing DER-encoded X.509v3 certificates that are
 * acceptable for signing.
 */
public void setSubject(List<byte[]> subjects)
{
    COSArray array = new COSArray();
    for (byte[] subject : subjects)
    {
        array.add(new COSString(subject));
    }
    this.dictionary.setItem(COSName.SUBJECT, array);
}
 
Example 23
Source Project: gcs   Source File: PDEncryption.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will get the OE entry in the standard encryption dictionary.
 *
 * @return A 32 byte array or null if there is no owner encryption key.
 *
 * @throws IOException If there is an error accessing the data.
 */
public byte[] getOwnerEncryptionKey() throws IOException
{
    byte[] oe = null;
    COSString ownerEncryptionKey = (COSString)dictionary.getDictionaryObject( COSName.OE );
    if( ownerEncryptionKey != null )
    {
        oe = ownerEncryptionKey.getBytes();
    }
    return oe;
}
 
Example 24
Source Project: gcs   Source File: PDEncryption.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will get the UE entry in the standard encryption dictionary.
 *
 * @return A 32 byte array or null if there is no user encryption key.
 *
 * @throws IOException If there is an error accessing the data.
 */
public byte[] getUserEncryptionKey() throws IOException
{
    byte[] ue = null;
    COSString userEncryptionKey = (COSString)dictionary.getDictionaryObject( COSName.UE );
    if( userEncryptionKey != null )
    {
        ue = userEncryptionKey.getBytes();
    }
    return ue;
}
 
Example 25
Source Project: gcs   Source File: PDEncryption.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will set the Recipients field of the dictionary. This field contains an array
 * of string.
 * @param recipients the array of bytes arrays to put in the Recipients field.
 * @throws IOException If there is an error setting the data.
 */
public void setRecipients(byte[][] recipients) throws IOException
{
    COSArray array = new COSArray();
    for (byte[] recipient : recipients)
    {
        COSString recip = new COSString(recipient);
        array.add(recip);
    }
    dictionary.setItem(COSName.RECIPIENTS, array);
    array.setDirect(true);
}
 
Example 26
Source Project: gcs   Source File: PDEncryption.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * Get the Perms entry in the encryption dictionary.
 *
 * @return A 16 byte array or null if there is no Perms entry.
 *
 * @throws IOException If there is an error accessing the data.
 */
public byte[] getPerms() throws IOException
{
    byte[] perms = null;
    COSString permsCosString = (COSString)dictionary.getDictionaryObject( COSName.PERMS );
    if( permsCosString != null )
    {
        perms = permsCosString.getBytes();
    }
    return perms;
}
 
Example 27
Source Project: gcs   Source File: PDSeedValueCertificate.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * (Optional) A list of array of bytes containing DER-encoded X.509v3 certificates of acceptable
 * issuers. If the signer’s certificate chains up to any of the specified issuers (either
 * directly or indirectly), the certificate is considered acceptable for signing.
 *
 * @param issuers A list of byte array containing DER-encoded X.509v3 certificates
 */
public void setIssuer(List<byte[]> issuers)
{
    COSArray array = new COSArray();
    for (byte[] issuer : issuers)
    {
        array.add(new COSString(issuer));
    }
    this.dictionary.setItem(COSName.ISSUER, array);
}
 
Example 28
Source Project: gcs   Source File: FDFField.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will create an FDF field from an XFDF XML document.
 *
 * @param fieldXML The XML document that contains the XFDF data.
 * @throws IOException If there is an error reading from the dom.
 */
public FDFField(Element fieldXML) throws IOException
{
    this();
    this.setPartialFieldName(fieldXML.getAttribute("name"));
    NodeList nodeList = fieldXML.getChildNodes();
    List<FDFField> kids = new ArrayList<FDFField>();
    for (int i = 0; i < nodeList.getLength(); i++)
    {
        Node node = nodeList.item(i);
        if (node instanceof Element)
        {
            Element child = (Element) node;
            if (child.getTagName().equals("value"))
            {
                setValue(org.apache.pdfbox.util.XMLUtil.getNodeValue(child));
            }
            else if (child.getTagName().equals("value-richtext"))
            {
                setRichText(new COSString(org.apache.pdfbox.util.XMLUtil.getNodeValue(child)));
            }
            else if (child.getTagName().equals("field"))
            {
                kids.add(new FDFField(child));
            }
        }
    }
    if (kids.size() > 0)
    {
        setKids(kids);
    }

}
 
Example 29
Source Project: gcs   Source File: FDFField.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * This will get the value for the field. This will return type will either be <br>
 * String : Checkboxes, Radio Button, Textfields <br>
 * java.util.List of strings: Choice Field
 *
 * @return The value of the field.
 * @throws IOException If there is an error getting the value.
 */
public Object getValue() throws IOException
{
    COSBase value = field.getDictionaryObject(COSName.V);
    if (value instanceof COSName)
    {
        return ((COSName) value).getName();
    }
    else if (value instanceof COSArray)
    {
        return COSArrayList.convertCOSStringCOSArrayToList((COSArray) value);
    }
    else if (value instanceof COSString)
    {
        return ((COSString) value).getString();
    }
    else if (value instanceof COSStream)
    {
        return ((COSStream) value).toTextString();
    }
    else if (value != null)
    {
        throw new IOException("Error:Unknown type for field import" + value);
    }
    else
    {
        return null;
    }
}
 
Example 30
Source Project: gcs   Source File: PDSeedValueCertificate.java    License: Mozilla Public License 2.0 5 votes vote down vote up
/**
 * removes an OID from the list
 *
 * @param oid the object identifier to be removed.
 */
public void removeOID(byte[] oid)
{
    COSBase base = this.dictionary.getDictionaryObject(COSName.OID);
    if (base instanceof COSArray)
    {
        COSArray array = (COSArray) base;
        array.remove(new COSString(oid));
    }
}