Set Directory

hi,
could someone let me know how i can set the current directory
i am saving the contents of a table as follows,
using fileChooser to enter the name of the file, then passing this file name to another method in a different class which does the dirty work.
void menuSave_actionPerformed(ActionEvent e){
   chooser.setCurrentDirectory(new File("./Save"));
   int returnVal = chooser.showSaveDialog(this);
  if (returnVal == JFileChooser.APPROVE_OPTION)
  File file = chooser.getSelectedFile();
  tableTrack.save_table(file.getName());
       }**the save table Method in another class**
FileOutputStream fStream = new FileOutputStream("" + fileSaveName + "");
          ObjectOutputStream oStream = new ObjectOutputStream(fStream);
          oStream.writeObject(data);
          oStream.flush();
          fStream.close();is there a way to set the directory in this second method??
I have tired using
FileOutputStream fStream = new FileOutputStream("./SAVE" + fileSaveName + ""); but this simply adds the string ./Save to the file name. As no directory is set, All saved files are made in the same directory the code is compiled in.
cheers for any help.
RC

hi,
cheers!
is it not possible to use the two dots as in
[/code[
Full paths have the obvious problems!                                                                                                                                                                                                                                               

Similar Messages

  • Cannot set "'Directory'" (DynamicConfiguration UDF)

    Experts,
    in my scenario a generic interface (Proxy2Fille) is used, in which file receiver output FileName and Directory are being determined at runtime. this was implemented using udf at graphical message mapping phase. somehow, i am able to put "FileName" but can not put "Directory", I'm using 2 similar udf.
    setting Directory udf code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileDir = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File";,"'Directory'");
    conf.put(FileDir, Dir);
    when interface is being executed, i can see (sxmb_moni --> SOAP:Header) the udf were running and (as far as i get) that FileName and Directory parameters were successfully chased during the mapping phase.
    i.e., :
    SAP:DynamicConfiguration..
    <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="'Directory'">/rkv-erp/Int/XID</SAP:Record>
    yet, I'm getting the following error (RWB-Comunication Channel Monitoring):
    Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
    and obviusly, writing fails.
    what am i missing?
    Regards,
    Uri

    Hi,
    10x for your replay.
    both FileName and Directory are checked. I'm getting the recieved error (...The Adapter Message Property 'Directory' was configured as mandatory element...) since "Directory" is checked. in some of my tests, when i manipulate only FileName, everything went fine.
    Any other hint?
    Regards,
    Uri

  • "Unable to set directory" on Seagate 500gb Backup Plus USB Hard Drive

    I recently purchased a Macbook Pro as of today, I'm upgrading from windows, and I'm having issues trying to set up my external hard drive to download torrent files. I know with Windows, I can plug in the hard drive cfrom windows computer to another windows computer and have no issues with downloading torrent files. When I tried to get the torrent to download a file onto the external hard drive I recieved this error message:
    Unable to set directory
    Don't have enough permissions to write to '/Volumes/Seagate Backup Plus Drive'. Please choose another directory.
    I'm currently using uTorrent to download Bit Torrent files. I also tried to move files already on the external hard drive into another folder on the same hard drive, and it will not allow me to move the files.
    I was wondering if anyone knows of a solution to this problem?

    I managed to fix the issue

  • Dynamic Configuration - Set Directory Path for File Receiver Adapter

    Hi Experts,
    I have a question regarding the dynamic configuration for the file adapter. Is it possible to set a directory path without a message mapping for the file receiver adapter? the problem is that I want to import a pdf document. this pdf document I want to store in a dynamic directory (depending on the filename). so I have to read the filename out of the dynamic configuration and generate (depending on the filename) a directory for this file. Is that possible without a message mapping? I cannot make a message mapping because the file has the pdf format and should not get changed.
    best regards
    Christopher Kühn

    Hi Gaurav,
    I use the ASMA (respectively the filename) for the sender adapter. After the pdf was imported into XI this filename is in the ASMA.
    But what then??? How can I get this filename with the help of the variable substitution? and if I have this filename I have to change this filename a bit to generate the name / path of the directory.
    Please explain it to me detailled
    Thanks and regards
    christopher

  • Setting directory dynamically in File adapter in BPM 11g

    Hi,
    I am using file adapter in BPM 11g for writing perpose. While configuring, it is required to provide the directory location, which can be either physical path or logical. The location where the new file will be stored/saved is written in a text file. I want to fetch the location from that text file and want to store the new file in that particular location at run time. Please help !!!!

    Hi,
    You can dynamically set -among others- the outbound directory and outbound file name for a File Adapter. See: http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10231/adptr_file.htm#CIACICFD. If you need to retrieve the information beforehand from another file, you could use a synchronous read. See: http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10231/adptr_file.htm#BABDCEBE.
    Ronald

  • How to set directory to file locations in OWB 904

    Where I can to define a default directory for SQL* Loader control files and other data flat files?
    Any attributes in configure of mapping about location is only combo box with locations list, BUT locations doesn't allow to set any default dirrectories, because it did not have this attribute!!

    Hi Dmitry,
    I'm assuming you are trying to determine the directory that you will need to load data from.
    In this case, you pick a location, let's name it FF_DIR. You create as many locations in the FF module as required, however let's start with one.
    Then you will deploy the mapping to the database (or better the runtime platform) and register a location. This will be your default directory and all mappings that use this location will now use this directory.
    For an external table you will then create a directory with OWB that points to this location/directory by deploying the connector.
    Hope this helps,
    Jean-Pierre

  • Can't set directory path in a JTextField

    I've tried to set some directory paths in a JTextField, but nothing displayed in that the JTextField. However, i can print the directory paths one at a time to the console. The following is the code and will explain what I am trying to do:
    fileDialog.showOpenDialog(this);
    File[] classpath = fileDialog.getSelectedFiles();
    if(classpath.length == 0)
    return;
    String cp = "";
    for(int i = 0; i<classpath.length; i++){
    //System.out.println(classpath.getPath());
    cp.concat(classpath[i].getAbsolutePath());
    System.out.println(cp);
    jTextField_cp.setText(cp);
    if I uncomment the first print statement,each path will be shown on a new line in the console. But when I want to print the pathes of the directories in one time( concatenate them first), there's no output at all (the second print statement), I only got some empty new lines in the console. Is it any problems with the use of "cp.concat()" method?

    I'm pretty sure that it'll work if you replace your concat line with this.
    cp = cp.concat(classpath.getAbsolutePath());Java strings are passed by the value of their references, so you are only manipulating the value of the reference, the the string itself, unlike other objects. To work around that, assign cp the new string returned from the concat method.

  • File chooser set directory

    Is there any way of setting the directory the file chooser opens, as a default? If the files you are supposed to choose between are in the program's folder, I want the file chooser to open there, not somewhere else, so the user has to look around for the files... Anyone?

    The APIs are your friend.
    Love the APIs.
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFileChooser.html#JFileChooser(java.io.File)

  • How to set directory for preview files?

    I have my Media Cache folders set to an external hard drive, but Premiere Pro still continues to create hundreds of rendered preview files in the default location of Users/username/Documents/Adobe/Premiere Pro/8.0/Adobe Premiere Preview Files, filling up my main disk and then crashing when it gets full. Is the preview file folder a separate setting somewhere?
    Mac Pro 5,1, OSX 10.9.4

    I am having a problem with this as well since installing 8.0. PP 7.2.2 and previous versions did not have this issue.
    When I set the Media Cache preferences to store all cache on an external hard drive it will in fact do so with the exception of IMS files which it still puts in the default of C:\Users\USERNAME\AppData\Roaming\Adobe\Common\Media Cache Files.
    Win 7 Pro
    PP CC 2014
    2014.0.1 / 8.0.1

  • Setting Directory for utl_file

    Hi,
    We've just installed Oracle 11g on our server, and I'm having trouble determining what the directory name should be so that I can read it. I have tried:
    \users\mhoward\temp\
    \\servername\users\howardm\temp
    s:\servername\users\howard\temp
    What I'm doing on the server side is signing on as sys, and doing
    create or replace directory tempdir as 'c:\temp';
    grant read on directory tempdir to username;
    Then I look over at SQL Developer, and I do find the tempdir listed.
    Then I attempt to run a program. Here's my program:
    create or replace
    PROCEDURE proc_load1
    IS
    user_name VARCHAR2(30) := user;
    fhandler utl_file.file_type;
    buf varchar2(4000);
    BEGIN
    fhandler := utl_file.fopen('tempdir','oracletest.txt','R');
    utl_file.fclose(fhandler);
    exception
    when utl_file.invalid_path then
    raise_application_error(-20000, 'Invalid path');
    end;
    But, I keep getting invalid path!
    Would someone please tell me what I need to put in as the directory path for Windows on the server? I would like to point it to s:\users\howardm\temp, but I'm not sure how to do that.
    -Mary

    YES! My system administrator gave me access rights to the directory that Oracle was loaded on. I have create an alias called TEMPDIR that points to this, and was able to get it to work in my program:
    Signed on as SYS as SYSDBA:
    create or replace directory tempdir as 'D:\app\Administrator\product\11.1.0\temp';
    grant read,write on directory tempdir to user;
    In SQL Developer signed on as user:
    create or replace
    PROCEDURE proc_load1
    IS
    user_name VARCHAR2(30) := user;
    fhandler utl_file.file_type;
    buf varchar2(4000);
    BEGIN
    fhandler := utl_file.fopen('TEMPDIR','oracletest.txt','R');
    utl_file.get_line(fhandler,buf);
    dbms_output.put_line('Data from File:' || buf);
    utl_file.fclose(fhandler);
    exception
    when utl_file.invalid_path then
    raise_application_error(-20000, 'Invalid path');
    end;
    I noticed that even though I created it in lower case, it required it in upper case in the program to work.
    Thank you so much!
    -Mary

  • Set directory path

    I have to call native applications from within my java application (using the Runtime.getRuntime().exec() method). That works fine but I need to change the current directory path to a specific path.
    How it is done to change the current directory path with java ?
    Steffen Kux.

    You can use one class of mine that I already posted to this forums some time ago...
    /** executes multiple commands in one shell
    * @author: Giorgio Maone
    import java.io.*;
    public class MultiExec {
    static final boolean IS_WIN=System.getProperty("os.name").toLowerCase().indexOf("win")==0;
    protected String shell=IS_WIN?"":"sh";
    public void setShell(String s) {
       shell=s;
    public String getShell() {
       return shell;
    public Process exec(String cmds[]) throws IOException {
      File f=File.createTempFile("muexec",".bat");
      PrintWriter out=new PrintWriter(new FileWriter(f));
      if(IS_WIN) out.println("@echo off");
      for(int j=0,len=cmds.length; j<len; j++)
        out.println(cmds[j]);
      out.close();
      f.deleteOnExit();
      return Runtime.getRuntime().exec(shell+" "+f.getCanonicalPath());
    public int execAndWait(String cmds[]) throws IOException {
       Process p=exec(cmds);
      new Pipe(p.getInputStream(),System.out).connect();
      new Pipe(p.getErrorStream(),System.out).connect();
      new Pipe(System.in,p.getOutputStream()).connect();
      int exitCode=-1;
      try {
       exitCode=p.waitFor();
       } catch(InterruptedException ex) {}
      return exitCode;
    static class Pipe {
       private InputStream in;
      private OutputStream out;
      public Pipe(InputStream in, OutputStream out) {
        this.in=in; this.out=out;
      public void connect() {
        new Thread() {
         public void run() {
          try {
           for(int b;(b=in.read())!=-1;) {
             out.write(b);
           out.flush();
         } catch(IOException ex) {}
       }.start();
    // Test code
    public static void main(String[] args) throws Exception {
    String path=args[0];
    String drive=path.indexOf(":")==1?path.substring(0,1):"";
    System.out.println("\nExit code:"+
      new MultiExec().execAndWait(
       new String[]{
        drive,
        "cd "+path,
        args[1];
    }

  • FileReference set directory?

    I'm using  the FileReference to download files from a URL to the users machine. Is there a way to NOT automatically pop the the Browse dialog and tell the FileReference class which directory path, say one a user already specified in a text input,  without forcing the the user to specify in the Browse dialog?
    thanks in advance,
    -Mike

    Hi,
    @Mike
    it does matter what runtime is used: if you are using Flash runtime (web hosted, standalone player) then you won't have access to local filesystem without user interaction (including requirement for user triggered event to start some processes). That's part of Flash runtime security pragma. To be able to use Flash runtime (Flash plugin) based movie you would require to wrap that content with 3rd party tools that overcome that limitations.
    If you would use AIR runtime then you would have access to additional api (namely: flash.filesystem.File) that would allow you to achieve silent download without user interaction (as your end user had already installed application within its machine local sandbox, correct?)
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml
    There is also conceptual difference between runtimes and apis:
    in Flash runtime when using FileReference you do not care about some low level details - with cost that user have to select where content is to be saved.
    in AIR runtime (and in 3rd party tools) you would care about more details: for example to download file silently with AIR SDK (flash.filesystem.File) you would possible use FileStream class to start writing data locally as data arrives via URLStream (so file is downloaded asynchronously and operation is not blocking, etc). See:
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7dc2.html
    You could still use FileReference in AIR based runtime if that is OK for you to let user decide where to store content.
    regards,
    Peter Blazejewicz

  • Export / Copy / Setting directory - usability issues

    Hi,
    Three issues here:
    1. Run SQL, get output, then rt-click / Export Data / XLS
    comes up with directory
    C:\Documents and Settings\dagoddar\table_export.xls
    This is a lousy directory to store info.. and I cannot find anywhere in preferences to change this.....
    2. Open the spreadsheet and then run SQL and use rt-click / select all - then rt-click / Copy
    I only get the data, and no option to include the columns in the copy, which is pretty useless.
    3. Being able to post several SQL statements in a single spreadsheet is very helpful and SQL DEV appears to still be missing this basic functionality used by many users daily.
    Regards, Dave

    1) Tools | Preferences | Database | Select default path to store export in.
    2) Shift-ctrl-C
    3) You can request this enhancement in the sql developer exchange.

  • Setting ACL for Directory??

    There are only servlet ACL settings in the weblogic.properties,
    But how can I set directory ACL with weblogic server like in
    Apache or other webservers, can my file named .htaccess work?
    Thanks for help!

    There are only servlet ACL settings in the weblogic.properties,
    But how can I set directory ACL with weblogic server like in
    Apache or other webservers, can my file named .htaccess work?
    Thanks for help!

  • [Solved] Setting my own desktop environment

    Hi, I'm trying to setup my own desktop environment with the following packages:
    * slim
    * metacity
    * compton
    * wbar
    This is my slim conf:
    # Path, X server and arguments (if needed)
    # Note: -xauth $authfile is automatically appended
    default_path /bin:/usr/bin:/usr/local/bin
    default_xserver /usr/bin/X
    xserver_arguments -nolisten tcp vt07
    # Commands for halt, login, etc.
    halt_cmd /sbin/shutdown -h now
    reboot_cmd /sbin/shutdown -r now
    console_cmd /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
    #suspend_cmd /usr/sbin/suspend
    # Full path to the xauth binary
    xauth_path /usr/bin/xauth
    # Xauth file for server
    authfile /var/run/slim.auth
    # Activate numlock when slim starts. Valid values: on|off
    numlock on
    # Hide the mouse cursor (note: does not work with some WMs).
    # Valid values: true|false
    # hidecursor false
    # This command is executed after a succesful login.
    # you can place the %session and %theme variables
    # to handle launching of specific commands in .xinitrc
    # depending of chosen session and slim theme
    # NOTE: if your system does not have bash you need
    # to adjust the command according to your preferred shell,
    # i.e. for freebsd use:
    # login_cmd exec /bin/sh - ~/.xinitrc %session
    login_cmd exec /bin/bash -login ~/.xinitrc %session
    # Commands executed when starting and exiting a session.
    # They can be used for registering a X11 session with
    # sessreg. You can use the %user variable
    # sessionstart_cmd some command
    # sessionstop_cmd some command
    # Start in daemon mode. Valid values: yes | no
    # Note that this can be overriden by the command line
    # options "-d" and "-nodaemon"
    # daemon yes
    # Set directory that contains the xsessions.
    # slim reads xsesion from this directory, and be able to select.
    sessiondir /usr/share/xsessions/
    # Executed when pressing F11 (requires imagemagick)
    screenshot_cmd import -window root /slim.png
    # welcome message. Available variables: %host, %domain
    welcome_msg Bienvenido a %host
    # Session message. Prepended to the session name when pressing F1
    # session_msg Session:
    # shutdown / reboot messages
    shutdown_msg The system is halting...
    reboot_msg The system is rebooting...
    # default user, leave blank or remove this line
    # for avoid pre-loading the username.
    #default_user simone
    # Focus the password field on start when default_user is set
    # Set to "yes" to enable this feature
    #focus_password no
    # Automatically login the default user (without entering
    # the password. Set to "yes" to enable this feature
    #auto_login no
    # current theme, use comma separated list to specify a set to
    # randomly choose from
    current_theme archlinux-slim-theme-whitey
    # Lock file
    lockfile /var/lock/slim.lock
    # Log file
    logfile /var/log/slim.log
    Now, my desktop entry for the sessions, which is located $HOME/.config/joelDE/joelDE.desktop:
    [Desktop Entry]
    Name=joelDE
    Comment=Mi entorno de escritorio
    Exec=/home/joel/.config/joelDE/joelDE
    TryExec=/home/joel/.config/joelDE/joelDE
    Icon=/home/joel/.config/joelDE/joelDE.png
    Type=Application
    I made the symlink: ln -s /home/joel/.config/joelDE/joelDE.desktop /usr/share/xsessions/joelDE.desktop and it DOES appears in slim sessions (F1), now jolDE script:
    #!/bin/bash
    # mi propio entorno
    (sleep 1s && metacity --replace &)
    bash $HOME/.fehbg &
    xscreensaver -no-splash &
    (sleep 1s && compton --config $HOME/.config/compton.conf -b) &
    (sleep 1s && wbar) &
    and finally my .xinitrc:
    #!/bin/bash
    # ~/.xinitrc
    if [[ ! "$1" ]]; then
    WM_Name=startxfce4
    else
    WM_Name=$1
    fi
    setxkbmap -layout latam
    if [ -z "$GTK_PATH" ] ; then
    GTK_PATH="/usr/lib/gtk-2.0"
    else
    GTK_PATH="$GTK_PATH:/usr/lib/gtk-2.0"
    fi
    export GTK_PATH
    if [ -z "$GTK_MODULES" ] ; then
    GTK_MODULES="canberra-gtk-module"
    else
    GTK_MODULES="$GTK_MODULES:canberra-gtk-module"
    fi
    export GTK_MODULES
    export LANG=es_MX.UTF-8
    echo ${WM_Name} >$HOME/DE_name.txt
    if [ ${WM_Name} != "startxfce4" ]; then
    export DESKTOP_SESSION=${WM_Name}
    export GTK2_RC_FILES=$HOME/.gtkrc-2.0
    exec dbus-launch --sh-syntax --exit-with-session ${WM_Name} >$HOME/xinitrc-log.txt 2>&1
    else
    exec ${WM_Name} >$HOME/xinitrc-log.txt 2>&1
    fi
    # :~ EOF
    This is the thing: after choosing "joelDE" in slim sessions it shows a black screen and rerun slim...
    1.- Doesn't SLim run x11?
    2.- If not, how do I call it?
    Thanks!
    Last edited by Joel (2014-07-14 04:37:30)

    Try moving the metacity line in joelDE to the end of the file and remove the last '&':
    #!/bin/bash
    # mi propio entorno
    bash $HOME/.fehbg &
    xscreensaver -no-splash &
    (sleep 1s && compton --config $HOME/.config/compton.conf -b) &
    (sleep 1s && wbar) &
    sleep 1s && metacity --replace
    With startx, and I think that this is true for SLiM as well, your X session will last as long as your ~/.xinitrc (or, I think more technically, the exec $whatever that may be at the end of the file).  So if everything in ~/.xinitrc forks (or in your case, your joelDE script), that script will complete immediately, and the X session will exit with it.

Maybe you are looking for

  • Errors

    I am getting an error message when I attempt to download my purchased tunes that reads "There was an error downloading your purchased music. The disk could not be read from or written to." "Use the Check for Purchases comand in the Advanced menue to

  • I am trying to add an ipad mini that was given to me to my existing account with verizon

    I was given a brand new ipad mini for signing up for my masters at my school.  Of course they only have it set with the capability of using it with WiFi.  I called Verizon's tech support and asked if I could add the ipad to my existing account and us

  • URGENT HELP IS NEEDED!!!!!! How can i get two applet to communicate via a j

    I am writing a program that should allow me to communicate between applet. The applet is loaded via the a web site, but i can't get that to work, so i am using appletviewer instead. I want to establish a connection between the applets thus allowing t

  • Cable needed to output video to TV

    I'm a complete neophyte, when it comes to using my computer to watch video in my TV. I have a MacBook, model identifier 5,2. What cables would I need to transfer video from the Mac to a TV with HDMI connectors. Can it be done?

  • Java exception: Planning Data Form Import/Export Utility: FormDefUtil.sh

    Hi, We have the following in our environment Oracle 10gAS (10.1.3.1.0) Shared Services (9.3.1.0.11) Essbase Server (9.3.1.3.01) Essbase Admin Services (9.3.1.0.11) Provider Services (9.3.1.3.00) Planning (9.3.1.1.10) Financial Reporting + Analysis UI