/[schmitzm]/branches/2.4.x/src/skrueger/linux/LinuxUtil.java
ViewVC logotype

Annotation of /branches/2.4.x/src/skrueger/linux/LinuxUtil.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1328 - (hide annotations)
Sun Dec 5 19:34:11 2010 UTC (14 years, 2 months ago) by alfonx
Original Path: trunk/src/skrueger/linux/LinuxUtil.java
File MIME type: text/plain
File size: 696 byte(s)


1 alfonx 1328 package skrueger.linux;
2    
3     import java.io.File;
4     import java.io.IOException;
5    
6     /**
7     * Utility methods to do linux specific stuff, e.g. symbolic links
8     */
9     public class LinuxUtil {
10    
11     /**
12     * Creates a symbolic link
13     *
14     * @param from
15     * an existing {@link File}
16     * @param to
17     * the new file to create
18     * @throws IOException
19     */
20     public static void createSymlink(File from, File to) throws IOException {
21     ProcessBuilder processBuilder = new ProcessBuilder("/bin/ln", "-s",
22     from.getAbsolutePath(), to.getAbsolutePath());
23     Process started = processBuilder.start();
24     try {
25     started.waitFor();
26     } catch (InterruptedException e) {
27     new RuntimeException(e);
28     }
29     }
30    
31     }

Properties

Name Value
svn:eol-style native
svn:keywords Id URL
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26