How to get Folder Location by just providing folder name ?

Hi,
I want to get folder location by providing its name.
I created one folder on "E:\" drive and when I used following code in netbeans it giving me the current loaction of java file.
File directory = new File("SVN");
        boolean isDirectory = directory.isDirectory();
        if (isDirectory) {
            // It returns true if directory is a directory.
            System.out.println("the name you have entered is a directory  : "  +    directory); 
            //It returns the absolutepath of a directory.
            System.out.println("the path is "  + directory.getAbsolutePath());
        else {
            // It returns false if directory is a file.
            System.out.println("the name you have entered is a file  : " +   directory);
            //It returns the absolute path of a file.
            System.out.println("the path is "  +  directory.getAbsolutePath());
    }And i got following output
the name you have entered is a file  : SVN
the path is C:\Users\AjayS\Documents\NetBeansProjects\TestCodes\SVNBut my folder is located on "E:\" drive.
Regards,
Ajay

You will have to search for them. But that indicates something seriously wrong with the requirement. In effect you're using the local filename as a secondary key but there is no index on it. You should consider a database.

Similar Messages

  • How to get the location of the browser?(pt_BR, en_US, es_ES...)

    How to get the location of the browser?
    example: pt_BR, en_US, es_ES...

    Hi Eduardo Cordeiro,
    Sorry in reaching you late...I was out on a trip...
    You need to put the javascript in your Flex application html wrapper file ...in which your  Flex application SWF is embedded.
    Write the Javascript function in your html file as below :
    function getBrowserLanguage()
      var browserLanguage = navigator.browserLanguage;
      return browserLanguage;
    //In your mxml File you can access the JavaScript function in your MXML as below:
    var browserLang:String  = ExternalInterface.call('getBrowserType');
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?

    How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?
    any idea?

    Hi,
    From your description, my understanding is that you want to get user profile properties in provider-hosted app in SharePoint online using REST API.
    Here is sample code for getting user profile properties:
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    Here is a blog below about accessing data from the provider-host apps:
    http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get Folder or document service permissions  by using  KM API's

    Hi,
    Any help how to get Folder or document service permissions  by using  KM API's  
    Any help or hint is greatly appreciated.
    Thanks,
    Costa.

    Hi,
    I have tested it here and it works for me (this code lists the service permissions settings for folder /documents/temp/):
        RID rid = RID.getRID("/documents/temp");
        try {
          IUser user = (IUser) request.getUser().getUser();
          IResourceContext context = new ResourceContext(user);
          IResource res = ResourceFactory.getInstance().getResource(rid, context);
          IResourceFactory resourceFactory = ResourceFactory.getInstance();
          IRepositoryServiceFactory serviceFactory = resourceFactory.getServiceFactory();
          IAclService aclService = (IAclService) serviceFactory.getRepositoryService(res, IWcmConst.ACL_SERVICE);
          IResourceAclManager aclResourceManager = aclService.getAclManager();
          IResourceAcl resourceAcl = aclResourceManager.getAcl(res);
          boolean inheritedAcl = false;
          if (resourceAcl == null) {
            resourceAcl = aclResourceManager.getInheritedAcl(res);
            inheritedAcl = true;
          response.write("<strong>SERVICE PERMISSION OWNERS</strong><br>");
          IUMPrincipalList ownerList = resourceAcl.getOwners();
          IUMPrincipalListIterator ownerListIt = ownerList.iterator();
          while (ownerListIt.hasNext()) {
            IUMPrincipal ownerPrincipal = ownerListIt.next();
            String strPrincipal = ownerPrincipal.getId();
            response.write(strPrincipal + "<br/>");
          response.write("<br><strong>SERVICE PERMISSIONS</strong><br>");
          IResourceAclEntryList el = resourceAcl.getEntries();
          IResourceAclEntryListIterator it = el.iterator();
          while (it.hasNext()) {
            IResourceAclEntry entry = it.next();
            String strEntryPerm = entry.getPermission().getDescription();
            String strPrincipal = entry.getPrincipal().getId();
            response.write("<strong>" + strEntryPerm + "</strong> - principal: " + strPrincipal + "<br/>");
            IAclPermissionList plList = entry.getPermission().getMembers();
            IAclPermissionListIterator plListIterator = plList.iterator();
            while (plListIterator.hasNext()) {
              IAclPermission perm = plListIterator.next();
              response.write(perm.getDescription() + "<br/>");
        } catch (Exception e) {
          response.write(LogWriter.extractCallStack(e));
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
    Romano

  • How to get folder(directory path only not file path) from local file system

    Hi Firends,
    How to get folder(directory path only not file path) from local file system , whenevr i will click on browse button.
    Please give reply for this one , if anybody knows.
    Thanks,
    Anderson.

    Hi Anderson,
    if you're using flash.filesystem.FileReference - then it is run in black box - except of filename, size and creation data (and few other properties available after some operation succeeded). This is part of security features in Flash runtime (described in header section):
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference .html
    This for example implies that user can download a content to local machine - but that content cannot be loaded back into Flash runtime. For this you would need either Air runtime flash.filesystem.File:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml
    (so you would created Air runtime based application: desktop or mobile but not web, even as standalone project) or you would need one of 3rd party tools that add file access/file information features to standard Flash runtime applications converted to standalone native applications.
    hth,
    kind regards,
    Peter

  • Get folder name for item

    Hi All,
    I need to retrieve the folder name for where the item is stored to generate a report in following format in csv
    File Name Full Path Parent Folder Created By Last Modified By Number of Versions Total Size
    My code which gets all other info.
    function Get-DocInventory() {
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $site=Get-SPSite -Identity "siteURL"
    foreach ($web in $site.AllWebs) {
    foreach ($list in $web.Lists) {
    if ($list.BaseType -ne "DocumentLibrary") {continue}
    foreach ($item in $list.Items) {
    $data = @{
    # "Web Application" = $webApp.ToString();
    #"Web" = $web.Url
    "Site" = $site.Url
    "list" = $list.Title
    "Item ID" = $item.ID
    "Item URL" = $site.Url+"/"+$item.Url
    "Item Name"= $item.File.Name
    “Item Versions” = $item.Versions.Count
    "Item Created" = $item["Created"]
    "Extensions" = $item.name.split(".")[1]
    "Item Modified" = $item["Modified"]
    "Item Created By" = $item["Author"]
    "Last Updated by" = $item["Editor"]
    "File Size" = $item.File.Length/1KB
    New-Object PSObject -Property $data
    $web.Dispose();
    $site.Dispose()
    #Get-DocInventory | Out-GridView
    Get-DocInventory | Export-Csv -NoTypeInformation -Path D:\Scripts\Hemant\inventory.csv
    Coukld you please help me get folder name
    Thanks Basva

    To get the full Folder URL you could use:
    $item.File.ParentFolder.Url
    And just for the Folder Name use:
    $item.File.ParentFolder.Name

  • How to get my images always order by file name, and not by time of captur, in all the folders in the library?

    How to get my images always order by arquive name, and not by time of captur, in all the folders in the library?
    Sorry for the poor english, but im portugues.
    In the library we can change the order of classification of image by, time of capture, name of file etc... I'm wondering if its possible define to be always by the name of file.
    It ´s possible?
    And i have other question, in print label we have an option to auto rotate to feet in page to have the image using the maximum area in the page (auto rotate, zoom etc), its possible to change the orientation of the rotation to be always in  the other direction?

    The Muvos are USB Mass Storage devices and do not have the ability to display track information based upon ID3 tags.
    The Zens all read and display track info based upon ID3 tag information that is either gathered from an online source or entered by the end-user.
    If you want the track information displayed instead of the ID3 tag information, you could edit the ID3 tags and rename the title to whatever you have as the file name. Not sure why your file names would differ so much from the ID3 tag info though, almost all of my content has the same name for the filename as it does on the ID3 tag title.

  • How to get the location of a pageitem when there are pageitems with same UID?

    There are two text frames with same UID but on different pages( also defferent spreads ). What I want to know is how I can get the location of them both.
    The following code can only get the location of the first frame because the second frame has the same UIDRef with the first one(because they are in one document with same UID) .
        InterfacePtr<IGeometry> splineGeo(ItemRef, IID_IGEOMETRY);
        PMMatrix itemPMMatrix = ::InnerToPasteboardMatrix( splineGeo );
        PMRect  itemPMRect = itemGeo->GetStrokeBoundingBox( itemPMMatrix );
    Is there any way I can get the second frame location?
    Thanks a lot.

    No.
    Just copy the pageitems from master page to document page.

  • How to get the location of a jarfile in the java 1.6 cache

    In 1.5 i am using getResource() to get the location of the jarfile i need, but in 1.6 this does not work anymore. I found a webpage with a workaround for this, but unfortunately i did not bookmark it and i can't find it again. Does anybody know how to get a file url instead of an http url to the jar file?
    I need the location to this jarfile. There is no other workaround and please DO NOT respond and tell me, that i don't need the location in the cache! I read all threads on the java forums to this issue and i didn't find a good answer.

    java.io.File class can be used.
    File f = new File("filename");
    S.O.P(f.canRead());
    S.O.P(f.canWrite());You can set the attribute using Runtime class.
    Runtime r = Runtime.getRuntime();
    Process p =r.exec("attrib -r file");If you are working with unix,
    r.exec("chmod -permissionoptions file");

  • How to get the location of the last click.

    What I can't seem to figure out how to do is get the location of the last click. I'm not setting anything by using the click im using the click to test boundaries. Basically if I click within this area this happens if i click within this other area something
    happens, etc. Thanks for your help! Also feel free to say an easier way to do this if you know one.

    Your description about your issue is very vague but you could for example handle the MouseLeftButtonDown event for the "area" and then use the MouseEventArgs.GetPosition method to determine the coordinates of the mouse click relative to some element,
    e.g.:
    private void Canvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    Canvas canvas = sender as Canvas;
    Point p = e.GetPosition(canvas);
    double x = p.X;
    double y = p.Y;
    <Canvas Height="100" Width="100" Background="Red" MouseLeftButtonDown="Canvas_MouseLeftButtonDown">
    </Canvas>
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • How to get the location of the JMenuItem on the screen in actionPerformed

    How can I get the location of the JMenuItem on the screen in actionPerformed.
    When I use the function getLocationOnScreen() on JMenuItem or the object retruned by getComponent() I get IllegalComponentStateException.
    I have figured out that inside actionPerformed the parent of the JMenuItem which is JPopupMenu (that contains the JMenuItem) is not visible anymore (its isVisble() function returns false).
    Then how can I get the location on the screen of the JMenuItem or it�s popup menu such that I can use it in subsequent call to SwingUtilities.convertPoint(JMenuItem, int x, int y,frame), as I need to display a modal dialog box relative to the position of the popup menu in it�s frame.
    Regards,
    Janusz

    Thanks for reply.
    Unfortunately I have to figure out the location of the menu from within actionPerformed handler. At that point of time it is too late to overwrite JMenuItem. I probably could do some severe surgery in the code to implement my own JMenuItem derived class & overwrite processMouseEvent and pass the location attribute somehow to actionPerformed handler � but I am looking for some solution that would not require changes to the code outside actionPerformed handler.

  • How to get the location of the caret?

    Hello
    I want to get the location of the caret. Not the offset of the document.
    I have tried the Caret.getMagicCaretPosition(), but I think it gives me a point in viewport.
    How can I get the absoult location of the caret(the location on screen ,not in viewport)?
    Thank you very much.
    Best wishes

    Thankyou ,You reply seems to help me ,but I am still confused that this method returns void ,how can I get the result of the point on screen?
    When I want the caret location (the caret belongs to a JTextPane) on screen, I invoke :
    SwingUtilities.convertPointToScreen(textPane.getCaret().getMagicCaretPositon(),textPane);
    but how can I get the result of the convertion?
    Thank you!

  • How to get folder size in bytes

    Hi all,
    Is there a easy way to get folder size in bytes?  I don't want to check each file in it and then add them up.
    Thanks for any help.
    Anne

    Years ago, I found my home PC was lacking disk space and could not exaplain where all of the space went.
    At the same time I was teaching myslef how to use the Picture control and Windows did not allow you to check the size of a folder and it sub-folders. So I used that situation to learn about the picture control and LV at the same time.
    It worked and ran but very slowly.
    Soon after Greg McKaskle was putting together the first version of "The Good The Bad and The Ugly" and was looking for fodder to beat up. I offered and he accepted. When the time came for the presentation, my code was chosen as "The bad" since I had not learned how to do a cluster sort at that time so I wrote my own version of a bubble sort (the VI presents a Pie Chart of disk usage and clcik on the sectors of the Pie Chart allowed you to drill down so I hd to sort by sizes).
    So why am I telling you this long boring story?
    That code is attached for you to look at laugh and tell me how dumb I was.
    Feel free to beat me up. It can't be any worse than the abuse I got from Greg (I felt like I was being raped).
    Have fun!
    Ben
    Code is probably 6 or thereabouts. "Disk_Utility" is top level. Remember this is an example of how NOT to code.
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    DIsk_Pie_Utility.zip ‏162 KB

  • How to get Functional Location of a Workcenter?

    Hi there,
    I am looking for a function that brings me the functional location to a given workcenter of an operation (production order).
    In our case this is a one-to-one relation. In transaction IL03 I can see the workcenter on Location-tab. But how to get this functional location only with a work center that I know?
    How is this possible?
    Kind regards
    JetGum

    check if this [works>>>|http://www.sap-img.com/abap/customized-work-center-list.htm]

  • How to get the Location of the Device

    hi all,
    I want to find out the Location of the MObile device.
    I am trying to find out with the help of the Location API which was available in the CLDC 1.1.I am using the following code to get the Location
    try{
         Criteria cr = new Criteria();
         cr.setHorizontalAccuracy(500);
         LocationProvider lp = LocationProvider.getInstance(cr);
         Location l = lp.getLocation(60);
         Coordinates c = l.getQualifiedCoordinates();
         if(c!=null)
         double lat = c.getLatitude();
         double alt = c.getAltitude();
         double lon = c.getLongitude();
         locate = c.convert(alt,1);
    }catch(Exception e){System.out.println(e);}
    I used a seperate thread to get the Location.The thread was running it was not diaplying any value(in the Emulator).Can anybody tell me the possible output when we use the Emulator.
    Please help me,Thanks in advance
    Lakshman

    hi,
    Even though the Nokia was the leaders of the JSR 179.but the Specification were developed by the sun.So to my knowledge the device which will support CLDC 1.1 will support my code.
    at present i had a Blackberry 7100t,I have to check whether the device support the CLDC 1.1
    can anybody please tell me what are the mobile devices that support the CLDC1.1?
    lakshman

Maybe you are looking for

  • Creation of SP Groups for a site using javascript

    Hi, I need to create four SP Groups for a website. Here is my code to create a website: $(document).ready(function () { createSite(); function createSite() { var context = SP.ClientContext.get_current(); var collWeb = context.get_web().get_webs(); va

  • LMS 3.2 - Backup hangs with validating ANI-DB

    Hello all, on our Solaris Systems running LMS 3.2 backup struggles with backing up ANI-DB (even after doing Restore of orig db). As the problem arises on more than one LMS 3.2 system with same patch-level my question to you -> is this a known problem

  • Difference in core application of "SPARC 32-bit" vs "generic" WebLogic10.3?

    Hi guys, I really need your urgent advice on the topic above. My question is that is there a difference in the WEBLOGIC 10.3 CORE itself between these two version mentioned? My opinion think the only determining factor is the VM used that would deter

  • 'See Also' link error

    Hi all, I'm working with NW04. I've got a search iview set up to display the 'See Also' link and the 'Details' link. When I click on the 'See Also' link, I get the following error: #1.5#00145E2B07DA0045000000D50000122000041348B5D35030#1147102915969#c

  • Search Default for this Forum?

    Is there anyway to set a default to make searches of this forum more quickly accessed? Seems moronic to have to continually specify the forum when this is the only one I ever use? Dan Pride