Zitat von
anda_skoa
Was ich gerne noch hätte wäre ein paar Source Archive bei jedem Tool, die die Benutzung des Tools in verschiedenen Programmiersprachen zeigen.
Vielleicht hat ja jemand Lust das zu probieren
Gilt natürlich noch
Aber weil ich eh ein bischen Java Auffrischung nötig hatte (package im Anhang)
Code:
import org.freedesktop.portland.xdgutils.*;
class XDGUtilsTest
{
public static void main(String[] args) throws Exception
{
openURL();
openDir();
mailto();
simpleMail();
complexMail();
}
private static void openURL() throws Exception
{
XDGUtils.open(new java.net.URL("http://www.mrunix.de/"));
}
private static void openDir() throws Exception
{
XDGUtils.open(new java.io.File(System.getProperty("user.home")));
}
private static void mailto() throws Exception
{
XDGUtils.composeEmail(new java.net.URI("mailto:foo@example.com?subject=bar&body=foobar"));
}
private static void simpleMail() throws Exception
{
XDGUtils.composeEmail("foo@example.com", "Das ist nur ein Beispiel", "Text\nmit\nmehreren Zeilen");
}
private static void complexMail() throws Exception
{
XDGEmail email = new XDGEmail();
email.addToAddressee("\"Developer Foo\" <foo@example.com>");
email.addToAddressee("\"QA Engineer Bar\" <bar@example.com>");
email.addCCAddressee("foo@beispiel.de");
email.addCCAddressee("bar@beispiel.de");
email.addBCCAddressee("boss@example.com");
email.addBCCAddressee("chef@beispiel.de");
email.setSubject("Product foobar crashes");
email.setBody("Your product it crap!\nIt crashes 10 seconds after startup");
email.exec();
}
}
Ciao,
_
Lesezeichen