JFileChooser for selecting a directory !!

Hi,
here's a question for u. I am using a JFileChooser with an "Open" dialog for
choosing a directory by
JFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY). Now it
works fine, except when i double click on a directory, which sets the
directory name in the "File Name" text box, now if I press "Open", it does
nothing, coz it cannot find that directory in this directory as it is
already in that directory!!
The way to make it work is to clear the "File Name" box and then press
"Open", which is very unprofessional and no dumb user will think of doing
that.
What feel is that the only way to do this is to be actually able to
access/modify the Open dialog box, which as far as I know, there is no way
as it is handled by the JVM itself.
Thanks for ur consideration.
P. Cheema

There are several problems with choosing directories from the JFileChooser, (I won't go into them here). I have written the following class to choose directories. I have only tested this some on windows, but it could be a good starting point for others.
import javax.swing.*;
import java.io.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
public class DirectoryChooser extends JFileChooser {
    public DirectoryChooser(File startDir) {
        super(startDir);
        this.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    public File getSelectedFile() {
        File    file    = super.getSelectedFile();
        if (file == null) {
            return file;
        String  dirName = super.getSelectedFile().getAbsolutePath();
        String  fileSep = System.getProperty("file.separator", "\\");
        if (dirName.endsWith(fileSep + ".")) {
            dirName = dirName.substring(0, dirName.length() - 2);
            file    = new File(dirName);
        return file;
    public void setCurrentDirectory(File file) {
        // Let the action take place, then override the 'Name' field.
        // This is equivalent to the user typing "." in the name field.
        super.setCurrentDirectory(file);
        FileChooserUI ui = getUI();
        if (ui instanceof BasicFileChooserUI) {
            ((BasicFileChooserUI)ui).setFileName(".");
[\code]

Similar Messages

  • JFileChooser for selecting directory?

    Hi,
    Are there any better alternative than JFileChooser if I want the user to be able to select a path only, not the filename?
    How could I do it if I necessarily have to use the JFileChooser? The user shall not select any file, only a directory...
    Regards,
    Anders

    Thanks, that helped!
    How could I loop through this directory (this level only, not subfolders), and get a list of all filename of a certain suffix?
    /Anders

  • Selecting a directory issue.

    I need to select all of the files within a certain directory and place them in an array. Here is the code which I have written so far.
    for (int i=0; i<numGroups; i++){
         System.out.print("Enter the path of the directory containing the images for group " + (i+1) + ".\nALL files must be in JPEG format. ");
         JFileChooser chooser = new JFileChooser();
         chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
         int returnVal = chooser.showOpenDialog(null);
         File[] files = chooser.getSelectedFile().listFiles();
         for (int j = 0; j < files.length; j++){
              System.out.println(files);
    It looks like it should work, but right before opening the file chooser it spits out this grimy error:
    2008-06-25 10:40:07.443 java[7248] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0xfb03, name = 'java.ServiceProvider'
    See /usr/include/servers/bootstrap_defs.h for the error codes.
    2008-06-25 10:40:07.444 java[7248] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)
    I have no idea how to even read this error message or how to fix it.
    Thanks,
    Collin

    You're on OS X, correct? Possibly debugging with Eclipse?
    I've had strange errors running/debugging with Eclipse on OS X in the past, but not this one. I googled for "CFMessagePort: bootstrap_register()" and come up with lots of stuff saying that it's a harmless error caused when you try to launch two processes with the same name (in this case "java") on the command line. An Apple developer even explicitly says "If your app is crashing, it's for some other reason." So this probably isn't an actual problem for you. It could be how Eclipse is launching and your application (assuming you're running Eclipse...).
    aquowf wrote:
    Also, the list of files which the program prints is incorrect. It prints out a .DS_Store file five times and does not print out any of the jpeg files which are in the folder.Not sure about this, but please note that when using JFileChooser to select a directory, you must navigate INTO the directory you want to select. Navigating to the parent directory, clicking on the desired directory with the mouse, and clicking "OK" does NOT cut it. In DIRECTORIES_ONLY mode, JFileChooser returns the directory whose contents it is displaying. A file chooser is an unintuitive way to select a directory; if you have the time and motivation, you may want to create a simple directory chooser dialog and use that instead, something like a tree view of all directories in the file system.
    As camickr said, create a shoft, self-contained, compilable example program that clearly demonstrates the multiple ".DS_Store" problem and we can help you diagnose what's wrong.

  • Problem using JFileChooser to select a destination directory

    If you set JFileChooser to DIRECTORIES_ONLY, a user has to single click on the desired directory and click on the approveButton. This works just fine - you get the user's desired directory using getSelectedFile().
    e.g. /home/joeuser/docs
    But if the user double-clicks on their desired directory (a common user practice), the directory is opened AND the directory name is stuck in the File Name: field. If they now click on the approveButton, the returned selected directory is the user's desired directory PLUS the name of the directory again. Not what the user intended.
    e.g. /home/joeuser/docs/docs
    Now, when you keep the File Name: field from being filled in when the user double-clicks on a directory, you have encounter another problem. The approveButton will not activate unless there is something in the File Name: field!
    Does anybody have a solution for the approveButton working with an empty File Name: field?
    Thanks,
    Scott

    I had the same problem. Gave up with JFileChooser and made a directory chooser that only display the diectory structure in a JTree and no file stuff at all.
    Source: http://www.msticky.freeserve.co.uk/JDialog_directoryChooser.java
    to use it; String selectedDirPath=JDialog_directoryChooser.choose(stringTitle, stringInitialSelectedPath)
    returns the selected directory path or null if none selected.
    To make it work alone you'll need to remove my RRException class. If you want to see it in use first download noname.jar from http://www.msticky.freeserve.co.uk
    ps. my site needs testing
    thanks, sticky

  • Browse button for selecting directory

    Hello All,
    I need to put a browse button in my jsp so that the user can select the directory where a file can be saved.
    How do I put this?
    <INPUT TYPE="FILE" NAME="fffile">
    This just gives me a open dialog.
    I need one which will give me the directory selected in the text box.
    Thanks in advance,
    Arun

    You can't. If you provide a link to a file, then when the browser gets that file, then it may prompt the user to save it or open it, depending on the file type, the browser's capabilities and the browser's settings.
    If you want to force a file to be downloaded, you can do one of two things:
    1) Tell the user to hold the shift key down when clicking a link, which prompts to "save link as..."
    2) Use a script or servlet or something to get the file for the link clicked on and change the headers to include:
    Content-disposition: attachment; filename=theFileName.ext
    which should also for the browser to save the file.
    But there's no way to select a directory to save in before hand.

  • Using JFileChooser to select directory only

    Hi. I am using JFileChooser to let the user to select the directory to save some files into the user-selected directory. I set the JFileChooser to show only directory and not files. Below show part of my code:
    private JFileChooser chooser = new JFileChooser();
    chooser.setFileHidingEnabled(true);
    chooser.setMultiSelectionEnabled(false);
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
         chooser.setDialogType(JFileChooser.OPEN_DIALOG);
    int state = chooser.showDialog(frame, "Select Directory");
    if (state == JFileChooser.APPROVE_OPTION )
    file = chooser.getCurrentDirectory();
    However, the File reference that i get is not the user-selected directory. Please help.
    Thank you.

    Hi,
    i found that if user writes in the text field of save dialog name of the file(but application needs directory), getCurrentDirectory() returns correct directory. but if user chooses directory, getCurrentDirectory() returns parent directory but getSelectedFile() returns correct one, so i suggest something like this(it's nasty but it works [i hope;])
    JFileChooser dirChooser = new JFileChooser("");
    dirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    if (dirChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION)
    java.io.File curDir = dirChooser.getSelectedFile().isDirectory()?dirChooser.getSelectedFile():dirChooser.getCurrentDirectory();

  • C# compiling error: 'System.Array' does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)

    Hello experts,
    I'm totally new to C#. I'm trying to modify existing code to automatically rename a file if exists. I found a solution online as follows:
    string[] allFiles = Directory.GetFiles(folderPath).Select(filename => Path.GetFileNameWithoutExtension(filename)).ToArray();
            string tempFileName = fileName;
            int count = 1;
            while (allFiles.Contains(tempFileName ))
                tempFileName = String.Format("{0} ({1})", fileName, count++); 
            output = Path.Combine(folderPath, tempFileName );
            string fullPath=output + ".xml";
    However, it gives the following compilation errors
    for the Select and Contain methods respectively.:
    'System.Array' does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type 'System.Array' could be found
    (are you missing a using directive or an assembly reference?)
    'System.Array' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'System.Array' could be
    found (are you missing a using directive or an assembly reference?)
    I googled on these errors, and people suggested to add using System.Linq;
    I did, but the errors persist. 
    Any help and information is greatly appreciated.
    P. S. Here are the using clauses I have:
    using System;
    using System.Data;
    using System.Windows.Forms;
    using System.IO;
    using System.Collections.Generic;
    using System.Text;
    using System.Linq;

    Besides your issue with System.Core, you also have a problem with the logic of our code, particularly your variables. It is confusing what your variables represent. You have an infinite loop, so the last section of code is never reached. Take a look 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.IO;
    namespace consAppFileManipulation
    class Program
    static void Main(string[] args)
    string fullPath = @"c:\temp\trace.log";
    string folderPath = @"c:\temp\";
    string fileName = "trace.log";
    string output = "";
    string fileNameOnly = Path.GetFileNameWithoutExtension(fullPath);
    string extension = Path.GetExtension(fullPath);
    string path = Path.GetDirectoryName(fullPath);
    string newFullPath = fullPath;
    string[] allFiles = Directory.GetFiles(folderPath).Select(filename => Path.GetFileNameWithoutExtension(filename)).ToArray();
    string tempFileName = fileName;
    int count = 1;
    //THIS IS AN INFINITE LOOP
    while (allFiles.Contains(fileNameOnly))
    tempFileName = String.Format("{0} ({1})", fileName, count++);
    //THIS CODE IS NEVER REACHED
    output = Path.Combine(folderPath, tempFileName);
    fullPath = output + ".xml";
    //string fullPath = output + ".xml";
    UML, then code

  • How to get the path when i select a directory or a file in a JTree

    How to get the path when i select a directory or a file in a JTree

    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.HeadlessException;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Iterator;
    * @author Frederic FOURGEOT
    * @version 1.0
    public class JTreeFolder extends JPanel {
    protected DefaultMutableTreeNode racine;
    JTree tree;
    protected JScrollPane scrollpane;
    final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
    * Sous-classe FSNode
    * @author Frederic FOURGEOT
    * @version 1.0
    private class FSNode extends DefaultMutableTreeNode {
    File file; // contient le fichier li� au noeud
    * Constructeur non visible
    private FSNode() {
    super();
    * Constructeur par initialisation
    * @param userObject Object
    FSNode(Object userObject) {
    super(userObject);
    * Constructeur par initialisation
    * @param userObject Object
    * @param newFile File
    FSNode(Object userObject, File newFile) {
    super(userObject);
    file = newFile;
    * Definit le fichier lie au noeud
    * @param newFile File
    public void setFile(File newFile) {
    file = newFile;
    * Renvoi le fichier lie au noeud
    * @return File
    public File getFile() {
    return file;
    public JTree getJTree(){
         return tree ;
    * Constructeur
    * @throws HeadlessException
    public JTreeFolder() throws HeadlessException {
    File[] drive;
    tree = new JTree();
    // cr�ation du noeud sup�rieur
    racine = new DefaultMutableTreeNode("Poste de travail");
    // cr�ation d'un noeud pour chaque lecteur
    drive = File.listRoots();
    for (int i = 0 ; i < drive.length ; i++) {
    FSNode node = new FSNode(drive, drive[i]);
    addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
    racine.add(node);
    // Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
    tree.addTreeExpansionListener(new TreeExpansionListener() {
    public void treeExpanded(TreeExpansionEvent e) {
    // lorsqu'un noeud est ouvert
    // on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
    TreePath path = e.getPath();
    FSNode node = (FSNode)path.getLastPathComponent();
    addFolder(node);
    ((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
    public void treeCollapsed(TreeExpansionEvent e) {
    // lorsqu'un noeud est referm�
    //RIEN
    // alimentation du JTree
    DefaultTreeModel model = new DefaultTreeModel(racine);
    tree.setModel(model);
         setLayout(null);
    // ajout du JTree au formulaire
    tree.setBounds(0, 0, 240, 290);
    scrollpane = new JScrollPane(tree);
         add(scrollpane);
         scrollpane.setBounds(0, 0, 240, 290);
    * Recuperation des sous-elements d'un repertoire
    * @param driveOrDir
    * @param node
    public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    addFolder(driveOrDir, node, 0);
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Recuperation des sous-elements d'un repertoire
    * (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
    * @param driveOrDir File
    * @param node DefaultMutableTreeNode
    * @param level int
    private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
    File[] fileList;
    fileList = driveOrDir.listFiles();
    if (fileList != null) {
    sortFiles(fileList); // on tri les elements
    // on ne cherche pas plus loin que le niveau maximal d�finit
    if (level > MAX_LEVEL - 1) {return;}
    // pour chaque �l�ment
    try {
    for (int i = 0; i < fileList.length; i++) {
    // en fonction du type d'�l�ment
    if (fileList[i].isDirectory()) {
    // si c'est un r�pertoire on cr�� un nouveau noeud
    FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
    node.add(dir);
    // on recherche les �l�ments (r�cursivit�)
    addFolder(fileList[i], dir, ++level);
    if (fileList[i].isFile()) {
    // si c'est un fichier on ajoute l'�l�ment au noeud
    node.add(new FSNode(fileList[i].getName(), fileList[i]));
    catch (NullPointerException e) {
    // rien
    * Recuperation des sous-elements d'un noeud
    * @param node
    public void addFolder(FSNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    for (int i = 0 ; i < node.getChildCount() ; i++) {
    addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Tri une liste de fichier
    * @param listFile
    public void sortFiles(File[] listFile) {
    triRapide(listFile, 0, listFile.length - 1);
    * QuickSort : Partition
    * @param listFile
    * @param deb
    * @param fin
    * @return
    private int partition(File[] listFile, int deb, int fin) {
    int compt = deb;
    File pivot = listFile[deb];
    int i = deb - 1;
    int j = fin + 1;
    while (true) {
    do {
    j--;
    } while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
    do {
    i++;
    } while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
    if (i < j) {
    echanger(listFile, i, j);
    } else {
    return j;
    * Tri rapide : quick sort
    * @param listFile
    * @param deb
    * @param fin
    private void triRapide(File[] listFile, int deb, int fin) {
    if (deb < fin) {
    int positionPivot = partition(listFile, deb, fin);
    triRapide(listFile, deb, positionPivot);
    triRapide(listFile, positionPivot + 1, fin);
    * QuickSort : echanger
    * @param listFile
    * @param posa
    * @param posb
    private void echanger(File[] listFile, int posa, int posb) {
    File tmpFile = listFile[posa];
    listFile[posa] = listFile[posb];
    listFile[posb] = tmpFile;

  • Column Header for Select AS kind of query

    Hi,
    I wish to write a csv file by using the odisqlunload function. I have wrote the funtion as :
    OdiSqlUnload "-FILE=#FILE_PATH/#FILE_NAME" "-DRIVER=<%=odiRef.getInfo("SRC_JAVA_DRIVER")%>" "-URL=<%=odiRef.getInfo("SRC_JAVA_URL")%>" "-USER=<%=odiRef.getInfo("SRC_USER_NAME")%>" "-PASS=<%=odiRef.getInfo("SRC_ENCODED_PASS")%>" "-FILE_FORMAT=VARIABLE" "-FIELD_SEP=," "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1" "-FETCH_SIZE=1000" "-QUERY=SELECT RPAD(CI_FT_GL.GL_ACCT, 31, ' '),LPAD(CASE WHEN CI_FT.CURRENCY_CD != CI_FT_GL_EXT.DIVISION_CURCY_CD THEN sum(CI_FT_GL_EXT.DIVISION_AMT) ELSE sum(CI_FT_GL.AMOUNT) END,17,' '),' ',RPAD(CI_DST_CD_CHAR.CHAR_VAL, 25, ' '),RPAD(CI_DST_CD_CHAR.DST_ID, 8, ' '),'RMB ',' ',RPAD(to_char(sysdate, 'YYYYMMDD'), 8, ' ') FROM CI_DST_CD_CHAR CI_DST_CD_CHAR,CI_FT CI_FT,CI_FT_GL CI_FT_GL,CI_FT_GL_EXT CI_FT_GL_EXT where (CI_FT.FT_ID = CI_FT_GL.FT_ID) AND (CI_FT_GL.FT_ID = CI_FT_GL_EXT.FT_ID(+)) AND CI_FT_GL.GL_SEQ_NBR = CI_FT_GL_EXT.GL_SEQ_NBR(+) AND (CI_FT_GL.DST_ID = CI_DST_CD_CHAR.DST_ID) AND (CI_DST_CD_CHAR.CHAR_TYPE_CD = 'DTLREF1') AND (trim(CI_FT_GL.GL_ACCT) is not null) AND (CI_FT.XFER_TO_GL_DT is null) AND (CI_FT.GL_DISTRIB_STATUS in ('G','M')) AND (trunc(CI_FT.SCHED_DISTRIB_DT) <= trunc(sysdate)) AND CI_FT.CIS_DIVISION = '#DIVISION' GROUP BY CI_FT_GL.GL_ACCT,CI_DST_CD_CHAR.CHAR_VAL,CI_DST_CD_CHAR.DST_ID,CI_FT.CURRENCY_CD,CI_FT_GL_EXT.DIVISION_CURCY_CD"
    Then i used a jython code to generate headers. Bcoz the OdiSqlUnload does not generate headers. But the jython code is not useful when we have sql statements lik 'Select AS' :
    SELECT RPAD(CI_FT_GL.GL_ACCT, 31, ' ') AS GL_ACCT,
    LPAD(CASE WHEN CI_FT.CURRENCY_CD != CI_FT_GL_EXT.DIVISION_CURCY_CD THEN sum(CI_FT_GL_EXT.DIVISION_AMT) ELSE sum(CI_FT_GL.AMOUNT) END,17,' ') AS GL_AMOUNT,
    My Jython code is:
    import string
    import java.sql as sql
    import java.lang as lang
    import re
    sourceConnection = odiRef.getJDBCConnection("SRC")
    output_write=open('d:/Bijal/output1.csv','r+')
    myStmt = sourceConnection.createStatement()
    my_query = "SELECT RPAD(CI_FT_GL.GL_ACCT, 31, ' ') AS GL_ACCT,
    LPAD(CASE WHEN CI_FT.CURRENCY_CD != CI_FT_GL_EXT.DIVISION_CURCY_CD THEN sum(CI_FT_GL_EXT.DIVISION_AMT) ELSE sum(CI_FT_GL.AMOUNT) END,17,' ') AS GL_AMOUNT,
    ' ' AS BLANK1,
    RPAD(CI_DST_CD_CHAR.CHAR_VAL, 25, ' ')AS DESCR,
    RPAD(CI_DST_CD_CHAR.DST_ID, 8, ' ')AS DST_ID,
    'RMB ' Currency_Cd,
    ' ' AS BLANK2,
    RPAD(to_char(sysdate, 'YYYYMMDD'), 8, ' ') AS DT_OF_TXN
    FROM CI_DST_CD_CHAR CI_DST_CD_CHAR,CI_FT CI_FT,CI_FT_GL CI_FT_GL,CI_FT_GL_EXT CI_FT_GL_EXT
    where (CI_FT.FT_ID = CI_FT_GL.FT_ID) AND (CI_FT_GL.FT_ID = CI_FT_GL_EXT.FT_ID(+)) AND
    CI_FT_GL.GL_SEQ_NBR = CI_FT_GL_EXT.GL_SEQ_NBR(+) AND (CI_FT_GL.DST_ID = CI_DST_CD_CHAR.DST_ID)
    AND (CI_DST_CD_CHAR.CHAR_TYPE_CD = 'DTLREF1') AND (trim(CI_FT_GL.GL_ACCT) is not null)
    AND (CI_FT.XFER_TO_GL_DT is null) AND (CI_FT.GL_DISTRIB_STATUS in ('G','M')) AND
    (trunc(CI_FT.SCHED_DISTRIB_DT) <= trunc(sysdate)) AND CI_FT.CIS_DIVISION = 'MF'
    GROUP BY CI_FT_GL.GL_ACCT,
    CI_DST_CD_CHAR.CHAR_VAL,
    CI_DST_CD_CHAR.DST_ID,
    CI_FT.CURRENCY_CD,
    CI_FT_GL_EXT.DIVISION_CURCY_CD"
    my_query=my_query.upper()
    if string.find(my_query, '*') > 0:
    myRs = myStmt.executeQuery(my_query)
    md=myRs.getMetaData()
    collect=[]
    i=1
    while (i <= md.getColumnCount()):
    collect.append(md.getColumnName(i))
    i += 1
    header=','.join(map(string.strip, collect))
    elif string.find(my_query,'||') > 0:
    header = my_query[7:string.find(my_query, 'FROM')].replace("||','||",',')
    else:
    header = my_query[7:string.find(my_query, 'FROM')]
    print header
    old=output_write.read()
    output_write.seek(0)
    output_write.write (header+'\n'+old)
    sourceConnection.close()
    output_write.close()
    But it does not populate for Select As statements and throws error lik:
    'mismatched character \'\\n\' expecting \'"\'', ('<string>', 8, 62, 'my_query = "SELECT RPAD(CI_FT_GL.GL_ACCT, 31, \' \') AS GL_ACCT,\n'))
    Plz help me get headers in my output file :)

    Solution1:
    Still you can achieve this by using sys_connect_by_path ( if you know the use of it) to generate header. below link can help with another approach.
    http://www.business-intelligence-quotient.com/?p=546
    Solution2:
    You need to create one file (header= true )with interface as suggested by sutirtha. Then you can copy (odifilecopy) this file to another directory with dynamic name (inside variable) and dynamic path. In this interface keep the truncate option to true so that everytime data wont be appended to the end of file. After reversing the file change the column name Manually from C1 to your ACTUAL_COL_NAME in file. Because ODI always generate the column names using C1,C2,C3 ....
    The only risk in second approach is that if someone will delete the file then you will get error. For this you need to create a temp table in ODI with all column-name (header in file). then using above jython code or sys_connect_by_path (select * from temp_table), you can generate the header easily. Now this file will be generated dynamically and can be used by the interface. So even if someone will delete the file you can generate it during run time.
    Thanks.

  • FM for browsing the directory name in presentation server

    Hi All,
    Can somebody give me the FM for browsing the directory name (not the file name) in the presentation server so that the path comes automatically in the parameter.
    Thanks in advance.
    Regards,
    Arun Mohan

    Please see the following program.  This will give you what you need.
    report zrich_0001 .
    parameters: p_path type localfile.
    at selection-screen on value-request for p_path.
      data: path_str type string.
      call method cl_gui_frontend_services=>directory_browse
          exporting
             window_title    = 'Select Directory'
          changing
             selected_folder = path_str
          exceptions
             cntl_error = 1.
      call method cl_gui_cfw=>flush
           exceptions
              cntl_system_error = 1
              cntl_error        = 2.
      p_path =  path_str.
    Regards,
    Rich Heilman

  • How to "select a Directory" from Browse button

    Hi all,
    I am new to Swing API.
    All I want is to create a TextField and a Browse button.
    User has to select a directory from Browse button and upon selection of the directory and clicking OK, the directory should be placed into TextField.
    Hope this is not new............
    Help me do this.....
    Thanks in advance
    Sreedhar

    Take a look at JFileChooser. You can build a JFileChooser instance that will allow the user to select DIRECTORIES_ONLY (hint, take a look at the constants), it should do the trick ... (even though it's pretty ugly alright)

  • What is everyone using for managing iPads and iPhones for an Active Directory network. We also have a BES server

    I am seeking a solution to manage iphones and ipads for my enterprise. A few are currently being used. I will need to go back and shut them down to gather the appropriate information necessary to manage them going forward. Looking for manageability, security remote wipe logging. Pretty much what I can do with a Blackberry on a bes seerver. I see several products available. Can someone point me to one that they are happy with?

    The Identity Service for Active Directory 10.3.0 is only available on Windows because it uses .Net functionality to work with AD. Even if you run everything else on Linux, you would still need a Windows server for the AD Identity Service.
    You can download it from edelivery.oracle.com as part number V14368-01. You can also find it on that site by performing a media pack search for:
    Select a Product Pack: Oracle Fusion Middleware
    Platform: Microsoft Windows (32-bit)
    Then navigate down into "Oracle® Application Server 10g Release 3 (10.1.3) Media Pack v31 for Microsoft Windows".
    The package is "Oracle WebCenter Interaction Identity Service for Active Directory 10.3.0 for Microsoft Windows".

  • Select root directory of the required rapid install disk

    Hi,
    Im installing EB12, 20% into the installation i get this message "select root directory of the required rapid install disk, Enter the location for the disk labeled: Oracle Applications Rapid Install - Database Disk1".
    I'm not sure why its not finding what it wants. I've followed all installation steps and extracted all zip files in the same stage directory. Any hints?
    Thanks in advance for any help :D
    Edited by: user8830084 on Sep 29, 2009 4:42 PM

    Hi,
    Im installing EB12, 20% into the installation i get this message "select root directory of the required rapid install disk, Enter the location for the disk labeled: Oracle Applications Rapid Install - Database Disk1".This error indicates that the stage area directory was not created successfully. Please mention the step you have followed to create the stage directory.
    Regards,
    Hussein

  • Need to select a directory name.

    I need a dialog that will allow me look through my computer and select a directory name only. The file name is automatically generated, I figured this part out.

    Thanks for your answers, but I already found how to use a "File Dialog Function" from looking at other postings. But I guess it's not working the way I am expecting.
    I attached a constant to the select mode input and set it to "existing dir" mode 3. Then attached a start path control to the start path.
    Now when the dialog opens to select a "directory", I can only select a file. The directory information is in the total file path but I really don't want to select on a file. I need to select a directory and have this information show up. I don't want to see a file name in the final selection.
    Any more information?

  • JFileChooser for v1.3 and v1.4 different?

    Hi..
    I recently installed JDK v1.4 for running this particular program that I'll be working on and found that I can't seem to get the display that is supposedly to be there (was working properly when using version 1.3)
    So was wondering if there's anyone who know what's the problem with this? Is there a different between the JFileChooser or something between 1.3 and 1.4 that they can't retrieve the file in the same way when i run the program? (i.e in 1.3, it will open up a file chooser dialog straight from the working directory as it is suppose to be where as it opens the file chooser from the default directory my document, in version 1.4)
    please help if anyone has any idea. Thanks!
    regards,
    yj

    I "think" I'm having the same problem as you are, but I might be wrong.
    What I want to do is start my JFileChooser in a specified directory.
    I construct my object like this...
    JFileChooser chooser = new JFileChooser(".." + File.separator);
    File cDir = chooser.getCurrentDirectory();
    System.err.println("cDir:" + cDir.toString());
    The code above SHOULD start the JFileChooser in the directory ABOVE the directory that I ran my code from. However, not matter what string I put in the constructor, it always starts me at my WINNT/Profiles/troccola/Personal directory.
    I read that the directory path passed into the constructor should be relative to the directory that the application was run from. This is what I'm using
    new JFileChooser(".." + File.separator);
    One more note.
    The getCurrentDirectory returns the directory that you would expect. That is, it returns the directory 1 level above the directory that the application was run from. However, the display is showing an entirely different tree.
    And, yes.. I've tried chooser.updateUI();
    Any other ideas?
    1.4.0-b92 on WinNT

Maybe you are looking for