[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to set localdirectory with user's profile environment  XML
Forum Index -> Development
Author Message
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi!

Is it possible to use environment variables in eclntconfig.xml?

Example that does not work:

Code:
 <clientconfig>
   <localdirectory value='%USERPROFILE%\temp\eclnt\local'/>
   
   <suppressautofilefunctions value='false'/>
 </clientconfig>
 


Regards,
Joachim
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi,
no - not possible.
Regards, Björn

PS: @all - this question is about the JavaSwing client! So please do not get confused.

Björn Müller, CaptainCasa GmbH
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi Björn,

what is the default - omitting the tag.

And is there another way to set the download (lokal) folder?

Regards,
Joachim
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Default ist:

Code:
 
     FileUtil.getClientTempDirectory() + "eclnt/local/"
 
 and
 
     public static String getClientTempDirectory()
     {
         String osName = null;
         try { osName = System.getProperty("os.name"); } catch (Throwable t) {}
         if (osName == null) osName = "Windows";
         try
         {
             if (s_clientTempDirectory != null)
                 return s_clientTempDirectory;
             File tempFile = File.createTempFile("test",null);
             String dirName = tempFile.getAbsolutePath();
             dirName = ValueManager.encodeIntoValidFileName(dirName,false);
             int lastSlash = dirName.lastIndexOf('/');
             s_clientTempDirectory = dirName.substring(0,lastSlash+1);
             if (osName.contains("Windows") == false)
             {
                 String userName = null;
                 try { userName = System.getProperty("user.name"); } catch (Throwable t) {}
                 if (userName == null) userName = "nouserdefined";
                 s_clientTempDirectory = s_clientTempDirectory + userName + "/";
             }
             return s_clientTempDirectory;
 


You see: it's the OS's temp-directory. For non-windows the current user name is appended as well.

Regards, Björn

Björn Müller, CaptainCasa GmbH
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi Björn,

the solution: Set filename attribute of t:filedownload appropriately ;-)

Regards,
Joachim

unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi Björn,


You see: it's the OS's temp-directory. For non-windows the current user name is appended as well. 


Most of our clients are using Windows. Is there a method to ensure that users's %temp% isn't deleted or set to system's temp? - Or any mechanism to avoid downloads of critical documents to c:\temp (systems's temp)?

Regards,
Joachim
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team