How can I reading environment variables (user variables)

Hi,
I hope someone can halp me out:
In the software that I develop it is neccessary to read some user (environment) variables, such as the temp folder of the current user.
I know that I can read out some system variables like this:
String homePath = System.getProperty("user.home");
But how can I read out some other variables, especially the temp folder of the current user?
Thanks

I might have misunderstood you, but I am notlooking
for the PATH variable. I need the location of
the
temp folder of the current user. This should be
called TEMP or so, but this does not work.Can you deduce from the link he provided, to lookat
System.getenv(), and find the "TEMP" environment
variable in what it returns to you?That said, I believe the "temp" folder may be
provided in one of the normal System properties
anyway, so you probably don't need to go that route.
Print all your System.getProperties() values, and see
if it's in there.Yepp. os.io.temp or something.

Similar Messages

  • How can I use environment variables in a controller?

    Hi all,
    How can I use environment variables in a controller?
    I want to pass a fully qualified directory and file name to FileInputStream and would like to do it by resolving an env variable, such as $APPLTMP.
    Is there a method somewhere that would resolve this??
    By the way,Did anyone used the class of "oracle.apps.fnd.cp.request.RemoteFile"?
    The following is the code.
    My EBS server is installed with 2 nodes(one for current,and other is for application and DB).I want to copy the current server's file to the application server's $APPLTMP directory. But the result of "mCtx.getEnvStore().getEnv("APPLTMP")" is current server's $APPLTMP directory.
    Can anyone help me on this?
    private String getURL()
    throws IOException
    File locC = null;
    File remC = new File(mPath);
    String lurl = null;
    CpUtil lUtil = new CpUtil();
    String exten;
    Connection lConn = mCtx.getJDBCConnection();
    ErrorStack lES = mCtx.getErrorStack();
    LogFile lLF = mCtx.getLogFile();
    String gwyuid = mCtx.getEnvStore().getEnv("GWYUID");
    String tmpDir = mCtx.getEnvStore().getEnv("APPLTMP");
    String twoTask = mCtx.getEnvStore().getEnv("TWO_TASK");
    // create temp file
    mLPath = lUtil.createTempFile("OF", exten, tmpDir);
    lUtil.logTempFile(mLPath, mLNode, mCtx);
    Thanks,
    binghao

    However within OAF on the application it doesn't.
    what doesnt work, do you get errors or nothing ?XX_TOP is defined in adovars.env only. Anywhere else this has to go?
    No, it is read from the adovars.env file only.Thanks
    Tapash

  • How can I pass environment variables to the child process?

    How can I pass environment variables to the child process? This is what I tried and it didn't work.
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("The value of custom.property is : " + System.getProperty("custom.property"));
         }and the result is:
    The value of custom.property is : null

    Complete test:
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-Dcustom.property=my property value", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my environment value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("Property value of custom.property is : " + System.getProperty("custom.property"));
              System.out.println("Environment value of custom.property is : " + System.getenv("custom.property"));          
         }

  • How can I display char if a variable is null

    Hi All,
    How can I display char if a variable is null  in sap business object
    item name
    Office Visits
    Non-Emergency ED Utilization
    Non-Preferred Pharmacy
    above items are value and they are populating for this month but form next month "Inpatient Stays" a new item will add at database level
    i want to display this item with current month
    final result should be
    item name
    Office Visits
    Non-Emergency ED Utilization
    Non-Preferred Pharmacy
    Inpatient Stays
    i have tried with ISNULL function but it is not working
    please help i am using SAP BO 3.1
    Thanks in Advance
    Ranjeet

    You should be able to findout NULL using isnull([object]) function.. at report layer..
    Try with the below formula which should work for you
    =If Isnull(trim([object])) then "Inpatient Stays" else [Object]

  • How can i create a new user with only read rights ?

    How can i create a new user with only read rights ?

    You are asking about a Database User I hope.
    You can look into the Oracle 8i Documentation and find various privillages listed.
    In particular, you may find:
    Chapter 27 Privileges, Roles, and Security Policies
    an intresting chapter.
    You may want to do this with the various tools included with 8i - including the
    Oracle DBA Studio - expand the Security node and you can create USERS and ROLES.
    Or use SQL*Plus. To create a
    user / password named John / Smith, you would login to SQL*Plus as System/manager (or other) and type in:
    Create user John identified by Smith;
    Grant CONNECT to John;
    Grant SELECT ANY TABLE to John;
    commit;
    There is much more you can do
    depending on your needs.
    Please read the documentation.
    -John
    null

  • How can i read a stored picture in oracle Long Raw datatype? blob or clob?

    How can i read a stored picture in oracle Long Raw datatype? Like a blob or clob?....i am using jdk 1.3
    This is because...i tried to read it like a blob but i obtain a exception...about Type of column no valid......but the column exist....and it contains the long raw datatype of the pictures.....this is my code:
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.InputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.DriverManager;
    import oracle.sql.BLOB;
    import oracle.sql.BLOB.*;
    import oracle.jdbc.driver.*;
    import java.sql.*;
    class rec_ima1
    public static void main(String h[])
    Connection con = null;
    Blob bl;
    final ImageIcon image1;
    JPanel photo;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@123.3.12.213:1521:db_name","user","password");
    String query = "Select * from pictures where ID = '18840'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    if (!rs.next())
    System.out.println("Empty Result Set");
    bl = rs.getBlob(5);
    if (bl == null) {
    System.out.println("Null Blob");
    return;
    InputStream is = bl.getBinaryStream();
    int imageLength = (int) bl.length();
    System.out.println(imageLength);
    System.out.println(bl.length());
    byte[] imageData = new byte [imageLength];
    is.read(imageData, 0, imageLength);
    image1 = new ImageIcon(imageData);
    photo = new JPanel() {
    public void paint(Graphics g){
    g.setColor(Color.lightGray);
    g.drawImage(image1.getImage(), 0, 0, this);
    } catch (Exception e) {
    e.printStackTrace();
    Now i tried using clob:
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.InputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.DriverManager;
    import oracle.sql.CLOB;
    import oracle.sql.CLOB.*;
    import oracle.jdbc.driver.*;
    import java.sql.CallableStatement;
    class rec_ima4
    public static void main(String h[])
    Connection con = null;
    Clob cl;
    JPanel photo;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@123.3.12.213:1521:db_name","user","password");
    con.setAutoCommit (false);
    String query = "Select * from pictures where ID = '18840'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    while (rs.next()) {
    oracle.sql.CLOB clob = (CLOB) rs.getObject(5); //line 47
    } catch (Exception e) {
    e.printStackTrace();
    This is the runtime exception:
    java.lang.ClassCastException: [B
    at rec_ima4.main(rec_ima4.java:47)

    Thanks by answering to me......
    Well....i did that....but what is ImageIO?....
    I declared a ImageIcon imageIO, but this give me the following:
    rec_ima3.java:49: cannot resolve symbol
    symbol : class BufferedImage
    location: class rec_ima3
    BufferedImage bi = ImageIO.read(bInput);
    ^
    rec_ima3.java:49: cannot resolve symbol
    symbol : variable ImageIO
    location: class rec_ima3
    BufferedImage bi = ImageIO.read(bInput);
    ^
    What classes i have to import?.....what is ImageIO?
    Thanks

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • How can we read filenames from a specific folder

    Hi forum,
    I have a situation that, there are several files coming daily in a specific folder.
    I want to read filenames from that folder and want to get that filename in a variable.
    That filename contains account nos. which I need for further processing.
    Now, how can we read filenames from a specific folder with using Oracle PL/SQL Procedure?
    Please suggest.
    Thanks & regards,
    Kiran

    If you are on 10g (not sure which exact release I'm afraid) you might look at Chris Poole's XUTL_FINDFILES that lists the files in a directory using PL/SQL and DBMS_BACKUP_RESTORE.SEARCHFILES (all a bit undocumented as it seems to be provided as part of rman).
    The conventional (i.e. supported) approach is to use a Java stored procedure - there is an example on AskTom.
    Message was edited by:
    William Robertson

  • How can i set up multiple user accounts for my new ipad mini?

    How can i set up multiple user accounts for my new ipad mini?

    The iPad mini is basically a one user device. There are no Accounts. You can set up restrictions so that only you can do certain things.

  • How can i delete my old user ID

    One month ago I change my Iphone4 for a new one Iphone6, a soon as I set up, I can not loading any new programs in to.

    Hi
    Do not work, appear my old ID and, that Account do not reconized my password
    Regards.
    Carlos
    Sourcing Specialist.
    Idex Corporation
    Phone: *******
    Enviado desde mi iPhone
    El 04/02/2015, a las 7:59, Apple Support Communities Updates <[email protected]<mailto:[email protected]>> escribió:
    http://www.apple.com/support/assets/images/external/emails/logo.gif
    You received a reply
    Briansyddall<https://discussions.apple.com/people/Briansyddall?ac_cid=op123456> has replied to your question. You can view the full discussion<https://discussions.apple.com/message/27606356?ac_cid=op123456#27606356> in Apple Support Communities.
    How can i delete my old user ID<https://discussions.apple.com/message/27606356?ac_cid=op123456#27606356>
    Hi  Did you use the same Apple ID toxset up new iPhone? Try a Reboot press & hold power button & menu button hold both down until you see Apple Logo. You may need to do this for upto 50 Seconds. Cheers Brian
    Correct Answer <https://discussions.apple.com/email/thread/6814340/correct/27606356> Helpful Answer <https://discussions.apple.com/email/thread/6814340/helpful/27606356>
    Use the buttons above to tell Briansyddall and the rest of the community if this reply solved your question or helped you get closer to finding a solution.
    To reply to Briansyddall, go to the discussion<https://discussions.apple.com/message/27606356?ac_cid=op123456#27606356> in Apple Support Communities.
    You are receiving this email from Apple Support Communities. You can change your email preferences in your Apple Support Communities Profile<https://discussions.apple.com/user-preferences!input.jspa>.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM. Cupertino, CA 95014.
    All Rights Reserved<http://www.apple.com/legal/> | Privacy Policy<http://www.apple.com/legal/privacy/> | Terms of Use<https://discussions.apple.com/docs/DOC-5952> | Apple Support<http://www.apple.com/support/>
    This e-mail is intended solely for the intended recipient or recipients. If this e-mail is addressed to you in error or you otherwise receive this e-mail in error, please advise the sender, do not read, print, forward or save this e-mail, and promptly delete and destroy all copies of this e-mail.
    This email may contain information that is confidential, proprietary or secret and should be treated as confidential by all recipients. This e-mail may also be a confidential attorney-client communication, contain attorney work product, or otherwise be privileged and exempt from disclosure. If there is a confidentiality or non-disclosure agreement or protective order covering any information contained in this e-mail, such information shall be treated as confidential and subject to restriction on disclosure and use in accordance with such agreement or order, and this notice shall constitute identification, labeling or marking of such information as confidential, proprietary or secret in accordance with such agreement or order.
    The term 'this e-mail' includes any and all attachments.
    <Personal Information Edited by Host>

  • How can i create a new user in OID DIT tree programmatically  ?

    Dear All,
    How can i create a new user object in the OID DIT tree programmatically ?
    any help will be appreciated.
    Regards,
    Mohammed Amin

    Dear Eng. Jaime.. 
    Thank you so much  for replay...
    Can yon  explain 
    Do you want to create a contact in Jabber?
    Do you want to enable Jabber for a user?
    And what you meant last question..

  • How can I tell if a user has used IMAP?

    How can I tell if a user has used IMAP?
    <P>
    Check their mailbox for a file called "__VALIDITY__" If they have this
    file in their mailbox, they've used IMAP.

    You may want to refer to the Java Security forum at http://forum.java.sun.com/forum.jspa?forumID=545 for information on Kerberos & JAAS.
    There is a also a post in this forum, outlining how to utilise Kerberos, JAAS with JNDI to access Active Directory. JNDI, Active Directory and Authentication (Part 1) (Kerberos)
    at http://forum.java.sun.com/thread.jspa?threadID=579829&tstart=300
    Possibly the part you are looking for is the functionality included in the class that implements java.security.PrivilegedAction
    Good luck.

  • How can I read the bootstrap files and extract the fragment-URLs and fragment-numbers in plain text?

    How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
    Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh  f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
    Thank you!

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • How can I read a template and differentiate if it is a pattern matching template or a geometric matching template?

    Hey all,
    I would like to know how can I read a template´s information to know if it is a pattern macthing or a geometric matching template? 
    In my code, users provide templates and the algorithm must match them using pattern matching or geometric matching depending on the template.
    At the moment I am doing it by including a P or a G in the name of the file, but I would like to avoid this and read the information from the file.
    Any ideas?
    Thanks in advance,
    Esteban
    Solved!
    Go to Solution.

    Hey Esteban,
    you can use the VI "IMAQ Is Vision Info Present 2 VI" to reice the information:
    IMAQ Is Vision Info Present 2 VI - NI Vision 2011 for LabVIEW Help - National Instruments
    http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_is_vision_info_present_2/
    Take a look at the attached VI
    Stephan
    Attachments:
    Determine Pattern type.zip ‏13 KB

  • How can I read a document created under "pages" on a Mac book air on an other computer

    How can I read a document created under "pages" on a Mac book air on an other computer or even send this document in a mail to anyone ?

    Only Pages, Preview, Pages for iCloud beta, and Pages v2 or later on IOS 7 can open native Pages v5.2.2 (.pages) documents. Sending a Pages v5.2.2 document to someone without Pages v5.2.2 is futile.
    If you are using Gmail or Dropbox, you will need to right-click on that Pages document, and then choose compress from the contextual menu. You can then attach filename.pages.zip, because it appears as a single document, and not a folder.
    Pages v5.2.2 has a Share button on the Toolbar. Providing your document is already in iCloud storage, you can Send a Link to iCloud via the following:
    The Share toolbar icon also allows you to Send a Copy to Email, Messages, and AirDrop. This will present you with the document export sheet, the same one you get if you chose to File > Export To menu item, as the alternative.
    If you are sharing document content with an MS Office user, then the document you want to send them is either a Word .docx, or .doc. If they want just a read-only view of your content, send a PDF, for improved cross-platform exchange.

Maybe you are looking for