Create filesystem (symbolic) links from java

I know that symlinks are not platform independent, so I already gave up to find a portable solution. But has anyone found a way to do a "ln" or "ln -s" from pure Java code?

I would think the answer is no.
As you are already aware, links are platform dependent.
For instance, VMS has an ASSIGN command that is similar to the UNIX ln command but differs in quality and duration.

Similar Messages

  • Create a navigation link from java webdynpro to ABAP BSP

    Hi gurus,
    we received a customer request; we have this scenario. We have created a custom Java WebDynrpo application that works with mySAP CRM.
    The customer request is the following:
    Into a webdynpro page it is possible to call a BSP application passing the parameter CRM_OBJECT_ID?
    In detail (Example): we want to call the BSP Application Account (with the BP 1000001) selected:
    http://domain:port/sap/bc/bsp/sap/crm_bsp_frame/entrypoint.do?appl=CRMM_ACCOUNT&CRM_OBJECT_ID=1000001.
    Thanks in advance.
    Eugenio.

    Hi All,
    First of all, thanks to everybody for the collaboration.
    I'm working to solve the problem. I have to specify better the customer request:
    The navigation should be from a custom webdynpro to the standard crm BSP FrameWork (CRM PC_UI) CRM_BSP_FRAME. If I try to launch a BSP application, Ex: CRMM_ACCOUNT, i see that the application create automatically a session id; this is the URL generated:
    http://name.domain.com:8034/sap(bD1pdCZjPTExMCZkPW1pbg==)/bc/bsp/sap/crm_bsp_frame/entrypoint.do?appl=CRMM_ACCOUNT.
    Now, my question is the following?
    Is there the possibility to call this (PC-UI) application through a custom webdynpro??
    Thanks in advance.
    Kind Regards.
    Eugenio.

  • How can I get permission to create a symbolic link?

    I am trying to create a symbolic link from a program, but I keep getting:
    A required privilege is not held by the client.
    I am running the program from my account which is in the Administrators group, and otherwise has admin rights. However, if I login to the Administrator account the program runs fine, so I know the program code is correct.
    I have checked the local security settings, and even added my account explicitly to the local security settings to create symbolic links, but that does not help. I have also turned of UAC, but that does not help.
    What do I need to do on Windows 8.1 to be able to create a symbolic link from an account other than Administrator?
    Cheers, Eric
    Eric Kolotyluk - software developer, music DJ, swing dancer

    Basically I have a Scala program that is doing:
      try {
        Files.createSymbolicLink(link21, folder1)
      catch {
        case fileSystemException: FileSystemException =>
          System.err.println("\n\t**** Error configuring test fixture ***\n\n")
          println(fileSystemException)
          if (fileSystemException.getMessage().contains("A required privilege is not held by the client"))
            println("You need to set permissions by...\n")
    Where Files is the java.nio API. In fact it's a unit test fixture that tests to make sure my code handles symbolic links properly. The test fixture creates a temporary directory, for example
    C:\Users\Eric\AppData\Local\Temp\testFolder-432432684744817467
    and more files and folders below that. In one folder, it tries to make a symbolic link to another folder.
    I tried what you said with Run As Administrator, in this case, I ran my Eclipse IDE as Administrator and the code works -- thanks for the tip :-)
    However, in practice, I need this to work as part of automated unit test running as part of a Maven build, so is there some way to set things up that do not require "Run As Administrator"?
    Now that I have one solution, I can probably figure out some hack, but I was hoping there would be some more simple straightforward way to do what I want.
    Eric Kolotyluk - software developer, music DJ, swing dancer

  • Can I Create A Symbolic Link to folders stored on an SMB Share folder?

    Hello,
    I am very new to Unix and was hoping that someone could point me in the right direction with regards to Symbolic links and an SMB share folder ....
    Have purchased an ext. LAN Drive enclosure (http://www.macpower.com.tw/products/hdd3/pleiades/pd_usblan) which connects to my wireless router via ethernet like my G5 (main Mac) - our iBook connects via Airport. I have copied all my general documents/files to the SMB share folder on the ext. drive so that I can access them from the G5 and also the iBook.
    However I'd also like to be able to store my actual Mail folder (/Users/Mark/Library/Mail/), , Safari folder (/Users/Mark/Library/Safari) + my Address Book and other folders sitting in the Application Support folder on my SMB share so all important docs/folders are in the one place. I've tried storing these folders on the SMB share and putting an Alias to these back in Users/Mark/Library/Mail etc but of course an Alias doesn't work.
    Question 1: Can I create a symbolic link to these files if these are stored on an SMB share folder? If so, could you please tell me exactly what I'd need to type into Terminal? My SMB Share path is smb://STORAGE-XXXX/MARK
    I have copied my iPhoto library and iTunes library to the SMB share and are working fine.
    Question 2: Is it possible/worth attempting to move my whole home folder to the SMB share folder? Ideally, I'd like to be able to access my Mail from the iBook as well. If I could log into either the G5 or the iBook and access my latest Mail, Address Book and other Application Settings, that would be perfect. Would this be possible?
    Thanks
    Mark.
    Dual 1.8GHz G5 (Rev.B), 2Gig RAM, 9600XT   Mac OS X (10.4)  

    Dear Mark,
    Yes you can. The command to create a link will look something like this:
    $ ln -s thisFolder /Users/mark/thatFolder
    I did this while I was hosting a microsoft based game. This put all of the players into a common directory.
    SMB just resolved the link and everything worked fine.
    However, as I understand it, some other applications do NOT work very well with links. As I have NOT tried it with other applications, I fear I can be of NO help to you in this matter.
    The only way to find out which applications work with links is to try them and see what happens.
    Best of luck,
    Kurt

  • Can Adobe Air Create a Symbolic Link (aka shortcut) ?

    Greetings,  I am working on an AIR application that automatically creates a directory tree for the user. Because there are many levels to the tree I want to have symbolic links to certain folders and files at the top level to speed navigation.   Can AIR create symbolic links ?  If not can anyone suggest a work around as this limitation would be  bad for my project.

    I thought I would post a few comments that might help others.  
    First, there does not seem to exist a symbolic link that is crossplatform regardless of the filesystem used (e.g., NTSF, FAT32, etc.).  In other words if you create a symbolic link in Windows XP on a network drive and then try to view that shortcut in Linux, Linux will not understand the shortcut. I tried  both the Junction and shortcut approaches.  Similarly is I create a symbolic link (ln -s) in Linux on a network drive, a Windows machine will not interpret it properly.  Since my app needs to support a heterogenous computers on a single LAN then I am SOL.
    However, if you have an app that will only be used by computers of the same type, or on a single computer, you can create symbolic links using Air V2.0. Air V2.0 supports calling executables/batch files and passing information to STDIN and getting STDOUT.  You could then write a batch file in whatever OS you are using.  However other than creating junctions using MS-DOS's linkd, I don't know how you would do this on Windows XP machine.
    If anyone has further comments on this thread I would be grateful.

  • Parse errors while creating a Web service from Java class!

    Can anybody tell me please, is it possible to create a Web Service from java class where the input from user is required ?
    I have the following program, which is successfully compiled, but when I'm trying to make a web service in JDeveloper, the following error occurs:
    "Validation failed.
    The implementation class primePackage.isPrime ofport type MyWebService contains parse errors."
    import java.io.*;
    import java.util.*;
    class isPrime
    public static void main (String args[])
    Scanner reader = new Scanner(System.in);
    int n;
    System.out.println ("Enter a number you want to know is it prime or not");
    n=reader.nextInt();
    if (isPrime(n))
    System.out.println ("True");
    else
    System.out.println ("False");
    static boolean isPrime (int n)
    int i=2;
    while (i<=n-1)
    if (n%i==0)
    return false;
    i++;
    return true;
    }

    Hi,
    Can anybody tell me please, is it possible to create
    a Web Service from java class where the input from
    user is required ?Yes, the parameters of your method will be mapped in WSDL.
    But i've some considerations about your code.
    I suggest you change the name of isPrime do Prime, its a good code convention to put the name of class starting with Upper case. and isn't good the name of class equals to name of method.
    I suggest you to change the "static boolean isPrime (int n)" to "public boolean isPrime(int n)" to publish a method as a WebService method it's must be public and not static. After this change try to generate your Web Service.
    Regards.

  • How I can create a XML file from java Aplication

    How I can create a XML file from java Aplication
    whith have a the following structure
    <users>
    <user>
    <login>anyName</login>     
    <password>xxxx</password>
    </user>
    </users>
    the password label must be encripted
    accept any suggestion

    Let us assume you have all the data from the jsp form in an java bean object..
    Now you want a xml file. This can be acheived in 2 ways
    1. Write it into a file using java.io classes. Say you have a class with name
    write("<name>"+obj.getName+</name>);
    bingo you have a flat file with the xml
    2. Use data binding to do the trick
    will recommend JiBx and Castor for the 2nd option
    Regards,
    Rajagopal

  • Chkconfig does not create right symbolic links

    Hello all,
    I am just adding a script to automate start / stop during Oracle Linux reboot. I figured out that the symbolic links are not created in the right order. To prove that, I create a small script for test purposes.
    =====================================================
    # #!/bin/sh
    # Name: init.test
    # chkconfig: 45 80 20
    # description: Script test for chkconfig
    echo "This is a test script only. chkconfig is not creating correct symbolic links."
    =====================================================
    Then I used chkconfig --add init.test
    It should be created entries for levels 4-5 only, but it creates more soft links in rc.d directories.
    find /etc -name "*init.test" | sort
    /etc/rc.d/init.d/init.test
    /etc/rc.d/rc0.d/K20init.test
    /etc/rc.d/rc1.d/K20init.test
    /etc/rc.d/rc2.d/K20init.test
    /etc/rc.d/rc3.d/K20init.test
    /etc/rc.d/rc4.d/S80init.test
    /etc/rc.d/rc5.d/S80init.test
    /etc/rc.d/rc6.d/K20init.test
    Even that chkconfig show the correct levels, I am just curious why it created more kill soft links in rc.d directories.
    chkconfig --list init.test
    init.test      0:off     1:off     2:off     3:off     4:on     5:on     6:off
    Someone could try to explain to me why the kill script has been added to runlevel 0, 1, 2, and 6? Am I missing something here?
    Appreciate your help on this.
    Cesar
    Edited by: CESARDBAIBM on Feb 18, 2013 2:43 AM

    see
    man chkconfigwhere you can find a good example including explanation
           For example, random.init has these three lines:
           # chkconfig: 2345 20 80
           # description: Saves and restores system entropy pool for \
           #              higher quality random number generation.
           This says that the random script should be started in levels 2,  3,  4,
           and 5, that its start priority should be 20, and that its stop priority
           should be 80.  You should be able to figure out  what  the  description
           says;  the \ causes the line to be continued.  The extra space in front
           of the line is ignored.

  • To create a database link from oracle to sqlserver with NT authentication

    Hi ,
    I need to create a database link from oracle 9i to sql server database with windows authentication.I dont have the database username and password instead the access is given to my NT ID and password.So can anyone provide me the information about creating a dblink to sql server with windows authentication.
    Thanks

    Oracle is attempting to log in to SQL Server using NT authentication.
    The Oracle process, however, is running presumably with a local admin account (normal for a Windows service). SQL Server has no idea what this local account is, so it denies the login.
    You could change the Oracle service to run as a known user (presumably not as your Windows ID but some other Windows ID you create explicitly for Oracle) and then grant that Windows ID in SQL Server appropriate privileges. That would mean, though, that when you queried tables over the database link, you'd be using that new Windows ID's privileges on SQL Server, not your Windows ID's privileges.
    As I've said, though, this is a general architectural limitation for a multi-tier architecture. The end system (SQL Server) generally has no idea who the end user (your Windows ID) is when that user is coming through a middle tier (Oracle). So it cannot apply end-user permissions to connections created by the middle tier.
    Justin

  • Create a Database Link from Oracle to MYSQL on windows

    Hi
    I need to create a database link from oracle to mysql database on windows to fetch some records.Can anyone help me on this?

    Search for Transparent Gateways, Heterogeneous Services...
    The Oracle SQL Developer have drivers to Access, MySQL and SQL Server.

  • How do I create a dial link from a hotspot on an image in Dreamweaver CS5?

    I understand how to create a link from text, or from an image, but I need to create a link within the image map so that clients on their cell phones can call by clicking on my chosen hotspot. Any suggestions?

    Right, thanks. I've had to adapt it and create 2 more duplicate contact images, for the other small screens as the image maps are too large on the smaller screens. But I managed to get it to work how I want. Thank you.
    But I can't figure out how to do the tel: link. I've tried so many variations. But when I update the website, and try it on my mobile phone (which by the way, is not an iPhone, it's just a Samsung Tocco Lite), the tel: links won't work, both on the images, and the raw text. My phone just keeps coming up with an error message, saying: "Invalid Phone Number".
    The text tel: links are: <div class="PhoneNumber"><a href="tel:+64-09-537-1458">09537 1458</a></div>
    I've had to put the phone numbers in seperate div tags, that way, I can hide each div tag, according to the layout for the screen sizes.
    And the image tel: links are: <area shape="rect" coords="6,36,110,59" href="tel:+649537 1458" />
    As you can see, both these tel: links are different, but both don't work.
    Is there something I've done wrong to make the error message pop-up instead of dialing the number? Or is it the case of it being my mobile phone that doesn't support it. How can I correct it in each instance if it is the case, so that it will work on all forms of mobile phones?
    Please note that I am in New Zealand, and the country code is 64. and 09 is the area code.
    Thanks.
    Edit: It doesn't matter now. I've managed to figure it out, and it now works on my phone.

  • How to create an ODBC entry from Java

    From Java application, how can I create an ODBC entry in Ms Windows client?

    I know of two ways you could do this. One is very dangerous, but I will describe it here. ODBC DSN's are created using a GUI application from within the Windows Control Panel. The GUI application manages a set of files found in the Windows directory. You can find them if you search for the ODBC. You should find odbc.ini and odbcinst.ini. These are text files, and you can view there structure using notepad. A Java program could open a stream and append whatever information you want to into these two files. The danger is that if you do it wrong, you will corrupt ODBC for all applications, so be very careful with this method.
    The 2nd method, as I described above has been discussed (to death) within this forum. Just spend a little time searching, and I know you will find what you need to implement using that method. This is the method I would recommend using.
    Good Luck,
    Joel

  • Help:create tree node dynamically from java code...

    hi there...can anyone give me solution how to create or add tree node dynamically from java code???
    currently i am using tree node to handle my menu...i try to create tree and add treenode dynamically from .java page, but it failed...can anyone give solution how to create tree ui from java code, so i can create a dynamic menu...thanz before...

    Hi:
    Just put the statements you would normally put on a sqlplus command line in jdbc statements and execute them?
    http://www-db.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html#0.1_executeUpdate
    MJG

  • How can i create absolute symbolic links

    The question is simply the Thread Topic,
    I want to create an Absolute Symlink, I have found some Apple Scripts that i think create relative Symlinks.
    I am not that familiar with Terminal, so any recomendations to go that route nned to be fully explained please?
    Thanks
    John

    I have a couple of Partitioned disks on my system and i need to make symbolic links for a number of folders that are on those Partitions.
    I could not get to te partitions via terminal, i now understand i have to use the /Volumes/Folder name in my ln command.
    thx
    John

  • Create an excel file from java

    I am using Jakarta's POI to create an excel file from MySql. The POI works well when a samll amount of data was written from MySql (created .xls file less than 3500KB). The problem is when a large amount of data need to be written to an excel file, java.lang.OutOfMemoryError Exception in thread "main" appears. In my project, I really need to have a large amount of data to be wriiten ton excel file. Do somebody has good solution for it?
    Thanks

    What about using some text files like csv
    (comma-separated value) file? It is plain text but
    Excel (and other spreadsheet programs) will be able to
    read it.
    But then there will be no formatting and bells and
    whistles. It was just an idea.Excel will also read HTML <TABLE>'s, with full formatting. There are some extra tags for numeric formatting, also. Just create an HTML table, and save to a file with .xls extension, e.g.:
    <TABLE>
    <TR bgcolor="#00FF7F">
    <TH>Agency ID</TH>
    <TH>POS ID</TH>
    <TH>Machine Serial</TH>
    <TH>Disk Serial</TH>
    <TH>MAC ID</TH>
    <TH>System Manufacturer</TH>
    <TH>Machine Type</TH>
    <TH>BIOS Manufacturer</TH>
    <TH>BIOS Version</TH>
    <TH>BIOS Date</TH>
    </TR>
    <TR bgcolor="#9ACD32">
    <TD>1000</TD>
    <TD>1069</TD>
    <TD STYLE='vnd.ms-excel.numberformat:@'>US215199248</TD>
    <TD STYLE='vnd.ms-excel.numberformat:@'>5C5AE88F3</TD>
    <TD STYLE='vnd.ms-excel.numberformat:@'>000423155334</TD>
    <TD>Hewlett-Packard</TD>
    <TD>Desktop</TD>
    <TD>American Megatrends Inc.</TD>
    <TD>JA.01.03US</TD>
    <TD>07/19/2001</TD>
    </TR>
    </TABLE>

Maybe you are looking for