コード例 #1
0
 /**
  * Create an Internet shortcut
  *
  * @param name name of the shortcut
  * @param where location of the shortcut
  * @param target URL
  * @param icon URL (ex. http://www.server.com/favicon.ico)
  */
 public static void createInternetShortcut(String name, String where, String target, String icon) {
   try (FileWriter fw = new FileWriter(where)) {
     fw.write("[InternetShortcut]\n");
     fw.write("URL=" + target + '\n');
     if (!icon.isEmpty()) fw.write("IconFile=" + icon + '\n');
   } catch (IOException iox) {
     /**/
   }
 }
コード例 #2
0
ファイル: ReviewDialog.java プロジェクト: rokstrnisa/RokClock
 /**
  * This function writes the generated relative overview to a file.
  *
  * @param f The file to write to.
  * @throws IOException Thrown if unable to open or write to the file.
  * @throws InsufficientDataException Thrown if unable to generate the overview.
  */
 public void writeToFile(File f) throws IOException, InsufficientDataException {
   f.createNewFile();
   FileWriter fw = new FileWriter(f);
   fw.write(generateOverviewText());
   fw.close();
 }