AirContentRevision (@Nullable ContentRevision cr, @Nullable String actualTextContent) { if (cr == null) { return null; } FilePath filePath = cr.getFile(); if (actualTextContent != null) { return new PartialTextAirContentRevision(actualTextContent, cr, filePath); } else if (cr instanceof ByteBackedContentRevision && isBinaryRevision(cr)) { return new BinaryAirContentRevision((ByteBackedContentRevision)cr, filePath); } else { return new TextAirContentRevision(cr, filePath); } }