Allows you to read and write web/internet shortcuts created in Windows, Linux, and Apple. Specifically, these are files with the following extensions: .url, .website, .desktop, .webloc. This library is part of the Web Shortcut Utility Suite.
This library has been tested on Android and appears to be completely compatible.
Maven Repository: http://mvnrepository.com/artifact/com.abcodeworks/webshortcututil
JavaDocs: http://abcodeworks.github.io/WebShortcutUtil-Java/javadoc/latest/
Source Code: https://github.com/abcodeworks/WebShortcutUtil-Java/
The library is published to the Maven repository. Use the following dependency:
<dependency>
<groupId>com.abcodeworks</groupId>
<artifactId>webshortcututil</artifactId>
<version>1.0.1</version>
</dependency>
-
To compile:
mvn compile -
To run unit tests (note that some file names contain unicode characters, so it may not work
on all operating systems - I tested successfully on Ubuntu 12.04):
mvn test
Detailed error information is in: target/site/surefire-reports -
To run unit tests in a debugger:
mvn -Dmaven.surefire.debug test
See http://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html -
to generate test coverage reports:
mvn cobertura:cobertura
xdg-open target/site/cobertura/index.html -
To generate javadocs:
mvn javadoc:javadoc
xdg-open target/site/apidocs/index.html -
To package:
mvn package
The jar file is in the target/ folder -
To deploy to the Maven repository:
Follow this guide: http://central.sonatype.org/pages/ossrh-guide.html To stage: mvn clean deploy You will be prompted for the GPG Passphrase To release: mvn nexus-staging:releaseNeed local settings.xml in ~.m2/ folder:
ossrh xxx yyyNeed GPG key set up:
For backuping up/restoring keys: https://help.ubuntu.com/community/GnuPrivacyGuardHowto
Some ideas for enhanced functionality:
- Improve ability to read an unknown shortcut from an input stream.
- For ".desktop" files, add logic to extract the names embedded in a shortcut (including all localized versions of the name). Similar logic could also be written for ".website" files.
- Explore unicode functionality for ".webloc" files. Will a Mac open a URL that has unicode characters?
- Add an ASCII conversion option to the filename creation routines (i.e. to remove unicode characters).
This project is released under the Apache License 2.0.
This project includes the following libraries:
- com.dd.plist - http://code.google.com/p/plist/ - MIT License
- com.beetstra.jutf7 http://jutf7.sourceforge.net/ - MIT License
All licenses can be found in the root folder.
-
Free Desktop:
http://standards.freedesktop.org/desktop-entry-spec/latest/ (used Version 1.1-draft) -
Windows URL (also applicable to Website):
http://stackoverflow.com/questions/539962/creating-a-web-shortcut-on-user-desktop-programmatically
http://stackoverflow.com/questions/234231/creating-application-shortcut-in-a-directory
http://delphi.about.com/od/internetintranet/a/lnk-shortcut.htm
http://read.pudn.com/downloads3/sourcecode/windows/system/11495/shell/shlwapi/inistr.cpp__.htm
http://epiphany-browser.sourcearchive.com/documentation/2.24.0/plugin_8cpp-source.html
http://epiphany-browser.sourcearchive.com/documentation/2.24.0/plugin_8cpp-source.html -
Webloc / Plist:
http://search.cpan.org/~bdfoy/Mac-PropertyList-1.38/
or https://github.com/briandfoy/mac-propertylist
http://opensource.apple.com/source/CF/CF-550/CFBinaryPList.c
http://code.google.com/p/cocotron/source/browse/Foundation/NSPropertyList/NSPropertyListReader_binary1.m
http://www.apple.com/DTDs/PropertyList-1.0.dtd