Create a directory on the server based on the username logged in the client

hello everybody,
All my files which are transferred from client to server are stored in a directory called "workspace".Before the user sends the files, he is authenticated.How can I create a directory on the user name who is logged in on the server???
Say, user1 has logged in and tries to send files to server.Now, I'd like to create a sub-directory user1 under work space so that all the files which he uploads will be stored under his name.When the user1 is logged in the first time, a directory will be created on his name else all files will be stored under his directory.
I'm using JDBC with my-sql.
ANy ideas??
Thanks for your time.

Well, it wouldn't matter what DB you are using....
You have the user name, correct?
You have the File object refering to the main directory, correct?
File userDir = new File(mainDir, username);
if(!userDir.exists()) {
   if(!userDir.mkdirs()) {
       throw new IOException("Can't make directory " + userDir.getAbsolutePath());
// use userDir to write any files...

Similar Messages

  • How can I create a directory on my server using FTP in applescript?

    Hi
    I have created a script which successfully uploads files to my server using FTP and a curl command.
    The one thing I haven't worked out how to do is how to create a directory on my server using applescript. At the moment I have to manually create the correct directory for the script to work, but would like to be able to automate everything.
    Would this be possible?
    Thanks
    Nick

    Thanks Bernard.
    I have tried that and still get the error message:
    "curl: Can't open '--ftp-create-dirs'!
    curl: try 'curl --help' or 'curl --manual' for more information
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    curl: (9) Server denied you to change to the given directory"
    The other relevant parts of the script are:
    set ftp_url to "ftp.****.org.uk/artists/" & artistName2 & "/assets/"
    set ftp_username to "*****@*****.org.uk"
    set ftp_password to "****"
    set ftp_entire to ftp_username & ":" & ftp_password & " ftp://" & ftp_url
    set outPath to outputFolder & fileCounter & ".jpg"
    and then...
    do shell script ("curl -T --ftp-create-dirs " & outPath & " -u " & ftp_entire)
    Like I said, all works fine when the directories are already in place. I have permissions for the artists folder set to "777", i.e. writable. Because the script is trying to create two directories at once, i.e. "artistName2" and then "assets" under it, I wondered if this was significant, but then I tried with just one new directory, and still got the error.

  • How to create a directory in application server

    Hi all,
    How to create a directory in application server through Progaram??
    eg:\tmp - is already existing
    I want to create \tmp\fi 
    Within \tmp\fi - i should able to store my file,,,
    Kindly help me urgent...

    Hello San,
    Either contact Basis guys at ur end for the same or u can do it dynamically via a piece of ABAP code, i hope it wll help u.
    call function 'GUI_CREATE_DIRECTORY'
         exporting
    dirname = '//<ip_address>/qfilesvr400/<host>/usr/sap/TST/SYS/Folder1'
         exceptions
              failed  = 1
              others  = 2.
    Reward If Helpful.
    Regards
    Sasidhar Reddy Matli.

  • RDC for MAC cannot connect to TS server with error message "You were disconnected from the Windows-based computer because of problems during the licensing protocol".

    the mac clients are running RDC for mac version 2.1 and they cannot connect to Windows 2008 R2 TS server. They get the error "You were disconnected from the Windows-based computer because of problems during the licensing protocol".
    really appreciated if someone have a fix for this.
    thanks,
    /dan

    Hey,
    Any proposed answer for this ?
    I face the same problem and my environment 
    and I've got same results as dle2k
    1. TS lic mode is set to per user confirmed it works for windows clients.
    2. the TS server's system log logged error "The Terminal Server security layer detected an error in the protocol stream and has disconnected the client".
    3. the reports shows per user cal has been issued to users. no temp per device cal has been issued.
    4. yes, CoRD works .
    5. we tried version 2.1.1 of the Mac RD Client but it also does not work.

  • Powerview Cannot connect to the server due to a security issue. The server may not have been able to match the host for silverlight

    Hello,
    I have a sharepoint 2010 sp1 CU Dec 2011 server with a SQL Server 2012 SP1 CU4 reporting services instance.  I am able to open Power View and use it normally when bypassing the ISA Reverse Proxy server.  However when going thru ISA I receive the
    following Error.
    Power View  Cannot connect to the server due to a security issue.  The server may not have been able to match the host for Silverlight.  This error appears after I click yes on an Internet Explorer Display Mixed Mode prompt.
    I've seen a couple references to this issue but not much.  This one mentions a clientaccesspolicy.xml file but I haven't had any luck with that.  http://connect.microsoft.com/SQLServer/feedback/details/716433/cannot-connect-to-the-server-due-to-a-security-issue-the-server-may-not-have-been-able-to-match-the-host-for-silverlight
    Any Ideas?  Thanks.
    Ryan

    Hi Ryan,
    Based on my research, the issue should occur due to a by design behavior in Threat Management Gateway (TMG). To work around this issue, you can use SSL between the TMG and the SharePoint Web Server.
    Hope this helps.
    Regards,
    Mike Yin
    TechNet Community Support

  • I keep getting this message "Sync encountered an error while connecting: Failed to connect to the server. Please try again" What's the problem in English

    I keep getting this message "Sync encountered an error while connecting: Failed to connect to the server. Please try again" What's the problem in English

    Hi,
    Sometimes the server is not available and you can get an error like this one. Usually it works if you try to sync later. If this doesn't work, take a look to [https://philikon.wordpress.com/2011/06/13/how-to-file-a-good-sync-bug/ this post] to learn how to report a bug.
    Let me know if this is helpful.

  • Sept 4, 2014 My iPhone is not connecting to the Hotmail servers. My other email accounts work on it but all the hotmail one comes up with is "The connection to the server failed". Are other people experiencing the same issues?

    Sept 4, 2014 My iPhone is not connecting to the Hotmail servers. Hotmail comes up with "The connection to the server failed". Are other people experiencing the same issues?  From: gnof51

    If your Hotmail account worked previously and it suddenly stopped and gave you that message, then it is likely a problem at th Hotmail end. Did you check the Hotmail website or contact Hotmail directly to see if they are experiencing problems?

  • The server process could not be started because the configured identity is incorrect

    Good morning
    I have the same problem as here, every moning i must writing pasword.
    https://social.msdn.microsoft.com/Forums/en-US/f95ee480-dda1-42fd-96af-596531e7ac2e/the-server-process-could-not-be-started-because-the-configured-identity-is-incorrect?forum=windowstransactionsprogramming
    But my configuration is the same as was answer in this post, may be you can help me with another idea?. Thanks.
    Windows 2008 R2 64Bit

    Both machines start with an automatic login so technically there is an interactive user.
    Nevertheless, it is an interesting point. i will try to configure the applications to run under a particular user and see if that changes anything.
    Thank you
    Peter

  • The Data Received from the server running AD RMS didn't match the expected format.contact your system administrator for further investigation.

    Hi All,
       We Have implemented AD RMS in our organisation recently.But the Problem we are facing here many users those are Ms office 2013 we will get the error"The Data Received from the server running AD RMS didn't match the expected format.contact
    your system administrator for further investigation." and those who are in Ms office 2010 Professional it says  
        "The service is Temporally unavailable.Ensure the you have   connectivity to this server.This error could be caused if you are working offline.Proxy setting are preventing your connection or intermittent network issue."
      Below are the workaround did,
    1.Able to reach to Our pipeline ADRMS cluster.
    2.We have a valid Certificate.
    3.if we type https://adrms.ourdomain.com its working fine.
    4.Manually put the registry setting for effected computers.
    5. Applied the Hotfixes:MicrosoftFixit50903,KB2627273.
       Kindly help or suggest us to resolve the above issue as many computers in domain are not working with IRM.
    Thanks and reqard,
    Mohammed Siddiq.

    Hi Mohammed,
    Were you able to fix the issue with CRL disablement?
    Did my post help you or make you laugh? Don't forget to click the Helpful vote :) If I answered your question please mark my post as an Answer.

  • Using Caching Service when the Server Sleeps or Users have logged out?

    When the Mac Mini Server logs out all users, the OS X Server 3 should still be running to my belief.  Thus the Caching Service of the OS X Server 3 should still be running.  However, in a number of cases, I found that the time taken for an app download after the first time uses the same time for download.  So, I guess the Caching Service is not performing at all when there is no Logged-in user.
    I further wonder why there is a Sleep Button at the User Log-in Screen and no wonder that the Server will not be providing Services (e.g. Caching Service) when the Server is in Sleep Mode.  Will the Server 3 be providing Caching Service while the Mac Mini Server has enter Sleep mode and it's just my configuration problem?

    Here is an explanation of how caching server works.
    http://nbalonso.com/os-x-server-caching/
    In summary:
    Your server periodically talks to apple.  Compares notes.  Verifies it is authentic.  Gets a certificate from apple to prove it is authentic.
    If your device asks for something (contacts apple), Apple says that you have a local caching server, and responds with the info telling your device to try your local server first.  (includes certificate info, so your device is confident the local server that responds is actually authorized to do so).
    If that goes well, then fine.  If not, then you device falls back to getting the info from Apple's servers.
    If your server is asleep, then this process won't work.  Your server is supposed to phone home to apple (hourly?) to keep proving it is authorized to server updates, and to update Aple's record that it is authorized to serve updates for your private network IP address.

  • Why can I not access My iPhone on my Air - they have the same cloud account - same iTunes - logged onto the same wifi network... and connected via USB - difficult much?!its killing me ahhh my screen smashed and i want access to my iPhone on my macbook

    Why can I not access My iPhone on my Air - they have the same cloud account - same iTunes - logged onto the same wifi network... and connected via USB - difficult much?!its killing me ahhh my screen smashed and i want access to my iPhone on my macbook..
    why is it sooo hard still --- can anyone inform me on this miracle app please
    thank you
    sincerely
    Theigalaxy

    find my iphone is something one needs to activate on the phone itself using the same appelID is nowhere near enough
    if it is then one can track, play a sound and remote whipe it from
    www.icloud.com
    if your screen is smashed and you think you can use find my iphone to get any data from your phone you are sadly mistaken

  • Cannot create Virtual Directory in Windows Server 2008 R2 SP1 Environment

    Dear all,
    I am trying install Reporting Services 2005 on a Windows Server 2008 R2 SP1 Enterprise machine.
    So far we successfully did the following steps
     - Install SQL Server Reporting Services
     - Configure Service Account (Domain-User)
    After creating virtual Directory, we made several steps to avoid HTTP 400 Bad Request in Report Manager:
    1. Disable LSA Loopback in Registry and restart server
    2. Enhance Service Startup time to 60000ms and restart Server
    3. Set Application Pool to ASP.NET 2.0 Classic Mode
    4. Modify RSWebApplication.config and set These entries:
    <ReportServerUrl>http://servername/ReportServer</ReportServerUrl>
    <ReportServerVirtualDirectory></ReportServerVirtualDirectory>
    After all the Reporting Services Configuration Manager still shows a red sign and we cannot continue creating the database.
    How is it possible to solve this?
    We appreciate any help.
    Best regards,
    Mark
    Mark Kuschel
    Blog
    Xing

    Hi Mark,
    As per my understanding, we can refer to the following methods to troubleshooting the issue you occurred.
    Install SQL Server 2005 Service Pack 3.
    Deleting the newly-created virtual directory using IIS manager and then rebooting the server.
    In the Report Manager Virtual Directory dialog box, create a virtual directory for Report Manager, then change the Website to Reporting.
    Enable Apply default settings.
    The following link is for your reference:
    http://www.mathgv.com/sql2005docs/SQL2005ReportingServicesInstall.htm
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How do you create a directory on Apps Server

    Hi
    Is there any way to create a directory on the apps server at runtime using any of the forms built-ins or WebUtil?

    Use the HOST command, since HOST works on the App Server. WebUtil works on the client PC.

  • Determining the Directories based on a condition to poll the file

    Hi All,
    I have One requirement, that i want to poll the file in the target directory  based on the following condition.
    1) If name1 = "ABC"   the file should go to //xi/test/file1.xml
    2) If name1= "XYZ" the file should go to //xi/develop/file2.xml
    How can i Achieve this requirement.
    Regards
    Bopanna

    How many Message Interfaces have to create
    3 One sender one each for 2 receivers
    howmany interface mappings have to create
    2
    howmany cc's have to create
    3 - 1 sender 2 receiver
    howmany Sender & Receiver agreements have to create
    3 - 1 sender 2 receiver
    howmany interface & Receiver determinations have to create
    1 receiver determination
    2 interface determination
    Regards,
    Prateek

  • "No connectivity with the server" error for one document but not the other, in the same document library

    We have a number of users all of a sudden getting "No connectivity with the server.  The file 'xxx' can't be opened because the server couldn't be contacted." errors trying to open MS Office docs (Word, Excel, etc.) in SharePoint with IE,
    just by clicking the link and selecting the "Read Only" option.  If they select the "Check Out and Edit" option, they can open the document no problem.  One of my customers gets the error on one document but not the other, in
    the same document library!  The older document (a weekly report) was copied and renamed as per standard procedure.  She can read the older document, but not the new one.
    It is definitely a profile issue, as other people have logged onto the machines of the users with problems and do not get the error.  We have also renamed people's c:\user profile folders and the corresponding Profilelist registry entry and the newly
    created profile does not experience the error for these people.  Renaming the profile back restores all their personal settings but the error reappears.  When we copied the old profile's folder structure into the new profile, many of the user settings
    were restored (but not all, like Dreamweaver settings) but the error did not appear.  We think that the system folders files (like AppData) weren't totally copied over so we're going to run another test using xcopy.  We are rebooting between
    logons to make sure all files are unlocked.
    The laptops and computers are mainly 32bit, Win7 Enterprise running IE9 and Office 2010 Professional Plus, but there's a few 64bit machines as well. The SharePoint farm has 1 WFE, 1 App Server running search and CA, and a shared database server running SQL
    2005 SP4.  SharePoint is 64bit MOSS 2007 with the latest CU.
    We've checked the logs on the client as well as on the server and there aren't any helpful entries.  We've also run Process Monitor, also with no helpful entries.  We're planning to run something like Fiddler next.
    It's not everyone, because there are many people are accessing the SharePoint system and the same files.  It is also not a permission thing, as we've tested by giving the users elevated permissions with no changes.  One person experiencing
    the errors is a Site Collection Admin.  That same person ran a test where I coped a simple Excel file into a Document Library which contained a problem file.  They were able to open it Read Only no problems that day, but the next day, the same
    file gave them an error.   In their case, they usually get a "xxx is not checked out" error and only occasionally get the "No connectivity with the server" error.
    We've tried lots of things including:
    Deleting IE cache
    Deleting SharePoint Drafts and webcache folder contents
    Running IE without add-ons
    Upgrading and Downgrading IE
    Uninstalling and re-installing IE
    Reinstalling our SSL certs
    Repairing Office
    Removing and then adding back in the Microsoft Office "Microsoft SharePoint Foundation Support" Office Tool 
    Deleting all HKLM and HKLU Office registry settings
    Toggling IE Compatibility Settings
    Toggling the IE Automatic Logon option
    Toggling the location of checked out files
    Adding the site in the trusted sites list
    Adding the site to the WebClient\Parameters registry locations
    Making sure the WebClient service is started
    Rebooting the machine (lol :)
    This is becoming a serious issue, not just because of the inconvenience for the users having to check out every document they want to read, but we have some files with macros that open up other documents to run which are now failing.  There aren't
    "check out" workarounds for some of those macros.
    We're planning to open a ticket with Microsoft, but I'm throwing it out here first in case someone has run into this before, or may have some suggestions on what to try next.  Thanks!
    -Richard.
    PS  I think this needs to be in the "General" forum instead?

    It took three days of dedicated troubleshooting, but I have found the cause of the errors, and a couple of fixes.  It helped tremendously that my own machine was throwing the error.  I have scheduled a couple of users to work with me to test the
    various fixes, to see which one works best, so the story isn't over yet.
    I had backed up my c:\users profile folder and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList registry key so I could restore my profile after I was done.  I made a copy of the profile folder and was using that for awhile,
    but then made another copy where I had deleted a lot of content out of it so that the copies would go faster.  Since a newly created profile did not have errors, I was trying to copy back as much of the profile as possible to make it easier for our users
    to get back to work.  Instead of blowing away their profile and starting from scratch (which we know worked) I wanted to narrow down what was causing the error and just skip that from the restore.  The concept was to keep as much as the users profile
    in tact (application settings, etc.) not just restoring their desktop and My Documents folders.
    When we first tested a few weeks ago, simply copying the folder contents didn't reproduce the error.  I then tried xcopy, but got the "can't read file" error.  Then I tried robocopy, and ran into the "junction" problem. 
    I went back to xcopy, and found that placing the excludes.txt file in the windows/system32 folder eliminated the error.
    So the process went as follows: 
    Reboot and log into the machine as another user
    Delete the profile and associated registry key
    Reboot and log into the machine as the affected user, creating a new profile, and there is no error
    Reboot and log in as the other user
    xcopy the contents of the skinned-down backed-up profile to the newly created profile
    Reboot and log in as the affected user, and the error occurs
    Repeat the above, but add items in the excludes.txt file to see what, when eliminated, causes the error not to appear in the last step
    I eventually found that skipping the c:\users\<profile folder>\appdata\local\Microsoft\office\14.0 folder allowed the entire profile to be copied over without the error occurring.  That was strange, because we've cleaned out the cache folders
    before which didn't fix the issue. 
    So I went about it the opposite way, and tried to delete the 14.0 folder from the restored profile, and after reboot, the error still occurred.
    What eventually worked was deleting the 14.0 folder and copying over a 14.0 folder from a newly created profile!
    One way to do this was to:
    Reboot and log in as another user
    Rename the c:\users profile folder
    Rename the appropriate [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList] registry key
    Reboot and log in as the affected user, confirm that there is no error
    Reboot and log in as the other user
    Copy the C:\Users\<profile folder>\AppData\Local\microsoft\Office\14.0 folder to the other user's desktop
    Delete new profile folder, and rename the backup to be the production folder
    Delete the C:\Users\<profile folder>\AppData\Local\microsoft\Office\14.0 folder and then paste the 14.0 copy from the desktop
    Reboot and log in as the affected user, confirm that there is no error
    We've tried this on a couple machines and it works.  I had to run Windows Explorer as Administrator to access the other profile's folders.
    We've also successfully copied a 14.0 folder created by one profile on one affected computer over another profile's folder on another computer, eliminating the error, so we're trying that first, as that is fewer steps.
    We may attempt to script this, but the self-help instructions are only 5 lines long:
    Reboot and log into the affected computer with another account
    Go to <link to location of 14.0 folder on network> and copy the 14.0 folder
    Run Windows Explorer as Administrator
    Go to c:\users\<profile folder>\appdata\local\microsoft\office and delete the 14.0 folder, and paste the copied 14.0 folder (trying to overwrite it makes Win7 want to merge the folders)
    Reboot and log into your normal account, and confirm the error is gone
    I'll come back and report after we go into the field with this fix, but after the few tests, I am cautiously optimistic that this is it.

Maybe you are looking for

  • Satellite C855D-S5351 - Downgrading W8 to W7 - Driver problem

    Hi Friends, Im a new forum member- I bought a laptop Toshiba Satellite C855D-S5351 with W8 factory. I hate W8. I have a W7 distribution cd, so I setting the hd and went to installed W7 in. All was ok, but the drivers went away in this process. I have

  • Air 2.6 Ubuntu Native Installer Problem

    Hi, i have a problem creating and native deb installer with Adobe 2.6 with Ubuntu 10.10, when i run this code on terminal: /home/victor/Flex_SDK/Flex_SDK_4.5.0/bin/adt -package -storetype pkcs12 -keystore /home/victor/Certificado.p12 -storepass secre

  • [SOLVED] Install arch on a partition and still access files on other

    Basicaly what i want to achieve is to have a dual boot system on my laptop where i can access the files in some sort of shared storage or just to be able to access my windows files when im booted up in arch is there a way to achieve this? Last edited

  • My Skype to Go Number Incompatible with Skype

    It's also happening to me. Around two month ago I started using MagicJack, everything works good with the phone, even when I call out US to my favorites/registered skype numbers works fine; but for no registered/favorite number I need to call through

  • How make mouse pointer active on any page

    When my mouse pointer is on a page, I have to click on the page to get my mouse to scroll. Is there a way to have the pointer automatically activate the page by just being on the page?