@Test public void getVersionList() throws Exception { final XWikiAttachment attach = new XWikiAttachment(); attach.setVersion("1.1"); assertEquals(1, attach.getVersionList().size(), "Version list was not one element long for version 1.1"); attach.setVersion("1.2"); assertEquals(2, attach.getVersionList().size(), "Version list was not two elements long for version 1.2."); attach.setVersion("1.3"); assertEquals(3, attach.getVersionList().size(), "Version list was not two elements long for version 1.3."); }
public List<Version> getVersionList() throws XWikiException { final List<Version> list = new ArrayList<Version>(); final String currentVersion = this.version.toString(); Version v = new Version("1.1"); for (;;) { list.add(v); if (v.toString().equals(currentVersion)) { break; } v = v.next(); } return list; }
XWikiAttachment implements Cloneable { public List<Version> getVersionList() throws XWikiException { final List<Version> list = new ArrayList<Version>(); final String currentVersion = this.version.toString(); Version v = new Version("1.1"); for (;;) { list.add(v); if (v.toString().equals(currentVersion)) { break; } v = v.next(); } return list; } }
XWikiAttachment implements Cloneable { public List<Version> getVersionList() throws XWikiException { final List<Version> list = new ArrayList<Version>(); final String currentVersion = this.version.toString(); Version v = new Version("1.1"); for (;;) { list.add(v); if (v.toString().equals(currentVersion)) { break; } v = v.next(); } return list; } XWikiAttachment(XWikiDocument doc, String filename);  XWikiAttachment(); }
XWikiAttachment implements Cloneable { public List<Version> getVersionList() throws XWikiException { final List<Version> list = new ArrayList<Version>(); final String currentVersion = this.version.toString(); Version v = new Version("1.1"); for (;;) { list.add(v); if (v.toString().equals(currentVersion)) { break; } v = v.next(); } return list; } XWikiAttachment(XWikiDocument doc, String filename);  XWikiAttachment(); AttachmentReference getReference(); long getId(); void setDocId(long id); long getDocId(); void setId(long id); @Override XWikiAttachment clone(); @Deprecated int getFilesize(); @Deprecated void setFilesize(int filesize); long getLongSize(); void setLongSize(long size); @Deprecated int getContentSize(XWikiContext context); long getContentLongSize(XWikiContext context); String getFilename(); void setFilename(String filename); DocumentReference getAuthorReference(); void setAuthorReference(DocumentReference authorReference); @Deprecated String getAuthor(); @Deprecated void setAuthor(String author); String getVersion(); void setVersion(String version); String getNextVersion(); Version getRCSVersion(); void setRCSVersion(Version version); String getComment(); void setComment(String comment); XWikiDocument getDoc(); void setDoc(XWikiDocument doc); void setDoc(XWikiDocument doc, boolean updateDirty); Date getDate(); void setDate(Date date); boolean isContentDirty(); void incrementVersion(); boolean isMetaDataDirty(); void setMetaDataDirty(boolean metaDataDirty); String toStringXML(boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context); String toXML(); Element toXML(XWikiContext context); void toXML(XMLWriter wr, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context); void toXML(OutputTarget out, boolean bWithAttachmentContent, boolean bWithVersions, boolean format,
        XWikiContext context); void toXML(OutputTarget out, boolean bWithAttachmentContent, boolean bWithVersions, boolean format,
        String encoding); Element toXML(boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context); void fromXML(String source); void fromXML(InputSource source); void fromXML(Element docel); String getContentStore(); boolean isContentStoreSet(); void setContentStore(String contentStore); XWikiAttachmentContent getAttachmentContent(XWikiContext xcontext); XWikiAttachmentContent getAttachment_content(); void setAttachment_content(XWikiAttachmentContent attachment_content); String getArchiveStore(); boolean isArchiveStoreSet(); void setArchiveStore(String archiveStore); XWikiAttachmentArchive getAttachmentArchive(XWikiContext xcontext); XWikiAttachmentArchive getAttachment_archive(); void setAttachment_archive(XWikiAttachmentArchive attachment_archive); @Deprecated byte[] getContent(XWikiContext xcontext); InputStream getContentInputStream(XWikiContext xcontext); @Deprecated Archive getArchive(); @Deprecated void setArchive(Archive archive); void setArchive(String data); synchronized Version[] getVersions(); List<Version> getVersionList(); @Deprecated void setContent(byte[] data); void setContent(InputStream is, int length); void setContent(InputStream is); void loadAttachmentContent(XWikiContext xcontext); @Deprecated void loadContent(XWikiContext xcontext); XWikiAttachmentArchive loadArchive(XWikiContext xcontext); void updateContentArchive(XWikiContext context); String getMimeType(XWikiContext xcontext); String getMimeType(); void setMimeType(String mimeType); void resetMimeType(XWikiContext xcontext); String getCharset(); void setCharset(String charset); boolean isImage(XWikiContext context); XWikiAttachment getAttachmentRevision(String rev, XWikiContext context); boolean apply(XWikiAttachment attachment); boolean equalsData(XWikiAttachment otherAttachment, XWikiContext xcontext); void merge(XWikiAttachment previousAttachment, XWikiAttachment nextAttachment,
        MergeConfiguration configuration, XWikiContext xcontext, MergeResult mergeResult); void setAttachmentContainer(AttachmentContainer container); @Override String toString(); }
XWikiAttachment implements Cloneable { public List<Version> getVersionList() throws XWikiException { final List<Version> list = new ArrayList<Version>(); final String currentVersion = this.version.toString(); Version v = new Version("1.1"); for (;;) { list.add(v); if (v.toString().equals(currentVersion)) { break; } v = v.next(); } return list; } XWikiAttachment(XWikiDocument doc, String filename);  XWikiAttachment(); AttachmentReference getReference(); long getId(); void setDocId(long id); long getDocId(); void setId(long id); @Override XWikiAttachment clone(); @Deprecated int getFilesize(); @Deprecated void setFilesize(int filesize); long getLongSize(); void setLongSize(long size); @Deprecated int getContentSize(XWikiContext context); long getContentLongSize(XWikiContext context); String getFilename(); void setFilename(String filename); DocumentReference getAuthorReference(); void setAuthorReference(DocumentReference authorReference); @Deprecated String getAuthor(); @Deprecated void setAuthor(String author); String getVersion(); void setVersion(String version); String getNextVersion(); Version getRCSVersion(); void setRCSVersion(Version version); String getComment(); void setComment(String comment); XWikiDocument getDoc(); void setDoc(XWikiDocument doc); void setDoc(XWikiDocument doc, boolean updateDirty); Date getDate(); void setDate(Date date); boolean isContentDirty(); void incrementVersion(); boolean isMetaDataDirty(); void setMetaDataDirty(boolean metaDataDirty); String toStringXML(boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context); String toXML(); Element toXML(XWikiContext context); void toXML(XMLWriter wr, boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context); void toXML(OutputTarget out, boolean bWithAttachmentContent, boolean bWithVersions, boolean format,
        XWikiContext context); void toXML(OutputTarget out, boolean bWithAttachmentContent, boolean bWithVersions, boolean format,
        String encoding); Element toXML(boolean bWithAttachmentContent, boolean bWithVersions, XWikiContext context); void fromXML(String source); void fromXML(InputSource source); void fromXML(Element docel); String getContentStore(); boolean isContentStoreSet(); void setContentStore(String contentStore); XWikiAttachmentContent getAttachmentContent(XWikiContext xcontext); XWikiAttachmentContent getAttachment_content(); void setAttachment_content(XWikiAttachmentContent attachment_content); String getArchiveStore(); boolean isArchiveStoreSet(); void setArchiveStore(String archiveStore); XWikiAttachmentArchive getAttachmentArchive(XWikiContext xcontext); XWikiAttachmentArchive getAttachment_archive(); void setAttachment_archive(XWikiAttachmentArchive attachment_archive); @Deprecated byte[] getContent(XWikiContext xcontext); InputStream getContentInputStream(XWikiContext xcontext); @Deprecated Archive getArchive(); @Deprecated void setArchive(Archive archive); void setArchive(String data); synchronized Version[] getVersions(); List<Version> getVersionList(); @Deprecated void setContent(byte[] data); void setContent(InputStream is, int length); void setContent(InputStream is); void loadAttachmentContent(XWikiContext xcontext); @Deprecated void loadContent(XWikiContext xcontext); XWikiAttachmentArchive loadArchive(XWikiContext xcontext); void updateContentArchive(XWikiContext context); String getMimeType(XWikiContext xcontext); String getMimeType(); void setMimeType(String mimeType); void resetMimeType(XWikiContext xcontext); String getCharset(); void setCharset(String charset); boolean isImage(XWikiContext context); XWikiAttachment getAttachmentRevision(String rev, XWikiContext context); boolean apply(XWikiAttachment attachment); boolean equalsData(XWikiAttachment otherAttachment, XWikiContext xcontext); void merge(XWikiAttachment previousAttachment, XWikiAttachment nextAttachment,
        MergeConfiguration configuration, XWikiContext xcontext, MergeResult mergeResult); void setAttachmentContainer(AttachmentContainer container); @Override String toString();  }