Zandero

sitemap reader and writer

License

License

GroupId

GroupId

com.zandero
ArtifactId

ArtifactId

sitemap
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Zandero
sitemap reader and writer
Source Code Management

Source Code Management

https://github.com/Zandero/sitemap

Download sitemap

How to add to project

<!-- https://jarcasting.com/artifacts/com.zandero/sitemap/ -->
<dependency>
    <groupId>com.zandero</groupId>
    <artifactId>sitemap</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.zandero/sitemap/
implementation 'com.zandero:sitemap:1.0'
// https://jarcasting.com/artifacts/com.zandero/sitemap/
implementation ("com.zandero:sitemap:1.0")
'com.zandero:sitemap:jar:1.0'
<dependency org="com.zandero" name="sitemap" rev="1.0">
  <artifact name="sitemap" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.zandero', module='sitemap', version='1.0')
)
libraryDependencies += "com.zandero" % "sitemap" % "1.0"
[com.zandero/sitemap "1.0"]

Dependencies

compile (3)

Group / Artifact Type Version
com.zandero : utils jar [1.1,)
com.zandero : http jar [1.0,)
ch.qos.logback : logback-classic jar [1.1.7,)

test (3)

Group / Artifact Type Version
junit : junit jar [4.12,)
net.trajano.commons : commons-testing jar [2.1.0,)
org.mockito : mockito-all jar [1.10.19,)

Project Modules

There are no modules declared in this project.

sitemap

Simple sitemap.xml generator and reader for single sitemap.xml files.

Setup

<dependency>      
     <groupId>com.zandero</groupId>      
     <artifactId>sitemap</artifactId>      
     <version>1.0</version>      
</dependency>

Sitemap generator

SitemapGenerator generator = new SitemapGenerator("http://some.domain.com");

// build a page link
WebPage page = new WebPage("/this/site")
   .change(ChangeFrequency.daily)
   .modified(1476796504000L)
   .priority(0.6D);

// add new page to list  
generator.add(page);  

// generate list  
List<String> map = generator.generate();

Output

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
		<url>
			<loc>http://some.domain.com/this/site</loc>
			<lastmod>2016-10-18T15:15:04.000Z</lastmod>
			<changefreq>daily</changefreq>
			<priority>0.6</priority>
		</url>
</urlset>

Sitemap reader

Reads in a given XML file or String and de-serializes it to list of WebPages

SitemapReader reader = new SitemapReader();
List<WebPage> pages = reader.read(sitemap);
com.zandero

Zandero

A collection of useful utilities, extensions and wrappers

Versions

Version
1.0