for (int i = 0; i < directoryLevels; i++) { int digits = i * digitsPerLevel;  result.append(File.separator).append( id.substring(digits, digits + digitsPerLevel)); }  String theName = result.append(File.separator).append(id).toString();  if (log.isDebugEnabled()) { log.debug("Filename for " + id + " is " + theName); }  return new File(theName);
StringBuffer bufFilename = new StringBuffer(); if (assetstore instanceof LocalFile) { bufFilename.append(assetstore.getCanonicalPath()); bufFilename.append(File.separator); bufFilename.append(sIntermediatePath); bufFilename.append(sInternalId); if (log.isDebugEnabled()) { log.debug("Local filename for " + sInternalId + " is " + bufFilename.toString()); } return new LocalFile(bufFilename.toString()); } if (assetstore instanceof SRBFile) { bufFilename.append(sIntermediatePath); bufFilename.append(sInternalId); if (log.isDebugEnabled()) { log.debug("SRB filename for " + sInternalId + " is " + ((SRBFile) assetstore).toString() + bufFilename.toString()); } return new SRBFile((SRBFile) assetstore, bufFilename.toString()); } return null;
    private static File getFile(TableRow bitstream) throws IOException    {        // Check that bitstream is not null        if (bitstream == null)        {            return null;        }        // Get the store to use        int storeNumber = bitstream.getIntColumn("store_number");        // Default to zero ('assetstore.dir') for backwards compatibility        if (storeNumber == -1)        {            storeNumber = 0;        }        File store = assetStores[storeNumber];        // Turn the internal ID into a file path relative to the asset store        // directory        String id = bitstream.getStringColumn("internal_id");        BigInteger bigint = new BigInteger(id);        StringBuffer result = new StringBuffer().append(store                .getCanonicalPath());        // Split the id into groups        for (int i = 0; i < directoryLevels; i++)        {            int digits = i * digitsPerLevel;            result.append(File.separator).append(                    id.substring(digits, digits + digitsPerLevel));        }        String theName = result.append(File.separator).append(id).toString();        if (log.isDebugEnabled())        {            log.debug("Filename for " + id + " is " + theName);        }        return new File(theName);    }