public static BlobEntry isBlobEntryForStoring(String repositoryLocation,String mimeType){
  RepositoryLocation location;
  try {
    location=new RepositoryLocation(repositoryLocation);
    Entry entry=location.locateEntry();
    if (entry instanceof BlobEntry) {
      BlobEntry blobEntry=(BlobEntry)entry;
      if (mimeType.equals(blobEntry.getMimeType())) {
        return blobEntry;
      }
 else {
        SwingTools.showSimpleErrorMessage("entry_must_be_blob",blobEntry.getName());
        return null;
      }
    }
 else     if (entry == null) {
      return createBlobEntry(repositoryLocation);
    }
 else {
      SwingTools.showSimpleErrorMessage("entry_must_be_blob",entry.getName());
    }
  }
 catch (  RepositoryException e) {
    SwingTools.showSimpleErrorMessage("cannot_access_repository",e);
  }
catch (  MalformedRepositoryLocationException e) {
    SwingTools.showSimpleErrorMessage("cannot_access_repository",e);
  }
  return null;
}

public static BlobEntry isBlobEntryForStoring ( String repositoryLocation , String mimeType ) { RepositoryLocation location ; try { location = new RepositoryLocation ( repositoryLocation ) ; Entry entry = location . locateEntry ( ) ; if ( entry instanceof BlobEntry ) { BlobEntry blobEntry = ( BlobEntry ) entry ; if ( mimeType . equals ( blobEntry . getMimeType ( ) ) ) { return blobEntry ; } else { SwingTools . showSimpleErrorMessage ( "entry_must_be_blob" , blobEntry . getName ( ) ) ; return null ; } } else if ( entry == null ) { return createBlobEntry ( repositoryLocation ) ; } else { SwingTools . showSimpleErrorMessage ( "entry_must_be_blob" , entry . getName ( ) ) ; } } catch ( RepositoryException e ) { SwingTools . showSimpleErrorMessage ( "cannot_access_repository" , e ) ; } catch ( MalformedRepositoryLocationException e ) { SwingTools . showSimpleErrorMessage ( "cannot_access_repository" , e ) ; } return null ; }
this method will check if the given location is either empty or is an blobentry of the given mimetype . if neither is the case , null will be returned . otherwise the blobentry denoting this location will be returned .
