Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omajid/xdg-java
Java bindings for various FreeDesktop.org standards
https://github.com/omajid/xdg-java
freedesktop java xdg
Last synced: about 2 months ago
JSON representation
Java bindings for various FreeDesktop.org standards
- Host: GitHub
- URL: https://github.com/omajid/xdg-java
- Owner: omajid
- License: lgpl-2.1
- Created: 2013-08-24T19:54:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-28T18:22:14.000Z (over 5 years ago)
- Last Synced: 2023-03-10T22:13:48.049Z (almost 2 years ago)
- Topics: freedesktop, java, xdg
- Language: Java
- Size: 36.1 KB
- Stars: 12
- Watchers: 5
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
`xdg-java`
==========This is a Java API that provides an easy to use implementations of
various
[Free Desktop specifications](https://www.freedesktop.org/wiki/Specifications/).
Use the correct application specific configuration, data and cache
directories. Safely read and write desktop entries without worrying
about parsing and escaping.Specifications
--------------The following specifications are currently implemented:
### [Base Directory Specification](https://www.freedesktop.org/wiki/Specifications/basedir-spec/)
Use this to access standard directories for data, cache and
configuration.Here's how to find the path to a cache file with the name `myCache`:
File cacheFile = new File(BaseDirectory.get(BaseDirectory.XDG_CACHE_HOME), "myCache");
### The [Desktop Entry Specification](http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/)Use this to read and write desktop entries, with full validation.
Here's how to read a desktop entry named `some.desktop`:
BufferedReader reader = new BufferedReader(new FileReader("some.desktop"));
DesktopEntry entry = new DesktopEntryReader(reader).read();
System.out.println("Name: " + entry.get(DesktopEntry.KEY_NAME));Install
-------Build and install using maven:
$ mvn clean install
If you are using maven, add a dependency to your `pom.xml` file:
org.freedesktop
xdg-java
0.0.1-SNAPSHOT
If you are using gradle, add a runtime dependency to your
`build.gradle` file:runtime "org.freedesktop:xdg-java:0.0.1-SNAPSHOT@jar"
For Ivy, add the following dependency to your `ivy.xml` file:
Contributing
------------
See `CONTRIBUTING.md` for details.License
-------LGPL v2. Please see the `LICENSE` file for details.
© Copyright Omair Majid