[NBUser]FileNotFoundException - File is in same folder!

Hi
I created a rudimentary program to test some functions in a game I'm developing:
package TextRPG;
import java.io.*;
import javax.swing.*;
import java.util.*;
public class Dungeon1 implements Environment
    public Map objects;
    public ArrayList map;
    /** Creates a new instance of Dungeon1 */
    public Dungeon1() throws Exception
        objects = new HashMap();
        map = new ArrayList();
        String s = "dungeon2.txt";
        load(new BufferedReader(new FileReader(new File(s))));
    public Environment add(GameObject g)
        return this;
    public void load(BufferedReader r) throws IOException
        String s = r.readLine();
        while(s != null)
            map.add(s);
            s = r.readLine();
        refresh();
        r.close();
    public void refresh() throws IOException
        Iterator it = map.iterator();
        while(it.hasNext())
            System.out.println(it.next());
}A text file called Dungeon2 is stored in the same folder as this file (TextRPG).
When Dungeon1 is initialized, a FileNotFoundException is immeadiately thrown, saying it can't find Dungeon2.txt.
I am using NetBeans, and I read something about someone else who had the same problem but never found an answer.
Thanks for the help!
-t3h1337n00b

Like i said:
put the file in c:\JavaProgs OR
change
    public Dungeon1() throws Exception
        objects = new HashMap();
        map = new ArrayList();
        String s = "dungeon2.txt";
        load(new BufferedReader(new FileReader(new File(s))));
    }into
    public Dungeon1() throws Exception
        objects = new HashMap();
        map = new ArrayList();
        String s = ".\\TextRPG\Dungeon2.txt";
        load(new BufferedReader(new FileReader(new File(s))));
    HTH
Lima

Similar Messages

  • How to read multiple files in the same folder?

    Suppose I have 100 txt files in the same folder, and I want to read them one by one. (order is not important). File name is also part of the information I want.
    How to do that?
    Thanks

    You need to use the directory to create a File (use the path name, w/o a file name). Then you need to ask for a list() (array of String containing name). To do that you'll need to implement the FilenameFilter interface, writing an accept() method that returns true if the file's name ends with ".txt".
    If that's not perfectly clear, try the java.io API docs and return more specific questions.

  • Files from Windows 7 are not alphabetized correctly on OS X, and can match identically named files in the same folder

    I receive MS Word files from students using Macs or Windows-based computers.  This year, files prepared by students using Windows 7 are not alphabetized correctly on my Mac (under Snow Leopard or Mountain Lion).  The same four students keep having their files put at the END of the alphabetical sort by name, even though the files should appear earlier in the list.  I have to copy the file contents and paste the contents into a new document to get the new document to appear in the right order, and if I do so, then BOTH the old and new files appear in the Finder, even though the names appear to be identical!  So can have to files with the same name in the same folder, which ought to be impossible.  Does anyone have any idea what's going on?

    Bingo! 
    The problem is not the letters themselves, but non-letter characters in the file name; this showed up with the fixed-width fonts. The apparent duplicates and mis-sorting are caused by dashes, which differ because they're done as en-dashes in one file name and em-dashes in the other file name, or by curly or straight apostrophes.  I didn't see that in the Finder window.
    I never saw this behavior before this year.  Last year, when I was using a Mac for the first time, I did not see any such problem, even though my students' files were named using the same conventions. When I was using a Windows-based laptop before that, I never saw the problem.
    Windows must do something to style the non-letter characters differently than a Mac.  Is there any place in Windows Explorer or the OS X Finder that styles characters this way?  I can see this being a big problem for someone who needs to sort very important data by name, when the files are coming from different operating systems!
    (I just Googled en-dash, em-dash, and curly quotes with file names, and found a good number of posts on various sites about similar problems based on ASCI character coding, html coding, Windows Explorer, and other applications.  Sometimes the files don't appear at all, because the application reading the file name can't deal with a certain ASCI code.  What a mess.)

  • Cannot re-save a file into the same folder

    Hi.
    I have a odd issue where users are unable to resave their documents into the folder that they have opened them from.  The folders in question are their home folders to which each user has full permission to access. You cannot save over the original
    file or even to the same folder and changing the filename makes no difference at all.  You can however save to a different folder within the users home folder.  I get an event 300 error/event when trying to save but no other errors other than a confirmation
    box saying the file hasn't saved.
    Has anyone else seen this before/
    Thanks
    Tom

    It seems like a permission issue, can you save new files to the location anyway?
    You can try clean boot to determine whether other programs are conflicting:
    http://support.microsoft.com/kb/331796/en-us

  • Downloading a file to the same folder as an applescript

    I have never used applescript before and have what should be a simple problem.
    I just want to download via FTP a file and have it in the same folder as script application.
    This is what I have and it downloads what I want, but to get it where I want. This puts it in my home directory. I think "path to me" needs to come in here somehow. Now I am dumb so probably need the whole script!! thanks.
    tell application "System Events"
    do shell script "curl 'ftp://user:password@server//www/htdocs/current/l.txt' -o ~/l.txt"
    end tell

    Try using:
    tell application "Finder"
    set path_2 to quoted form of POSIX path of (folder of (path to me) as alias)
    end tell
    tell application "System Events"
    do shell script "curl 'ftp://user:password@server//www/htdocs/current/l.txt' -o " & path_2 & "l.txt"
    end tell
    (41158)

  • Apple Mail 2.1.1 How to file replies in same folder

    Hi -I would love to be able to file replies to email in the same folder, as I try to keep projects organized in folders
    I know there is an applescript that will do this but it seems to be for Outlook Express only
    I know that I can use smart folders but I have to keep tweaking the criteria as people use multiple email addresses and subject lines, and I work with the same people on several different projects at once
    Has anyone got this figured out for Apple Mail?

    The easiest idea that comes to mind is to just "drag and drop" your replies where you want them after you have read them.

  • Trying to install photoshop elements 12    File Archive part of adobe premiere 12 is missing.  You need all files in the same folder

    rying to install photoshop elements 12    File Archive part of adobe premiere 12 is missing.  You need all files in the same folder

    It is actually a link from Tech Soup to a special link on Adobe.   But no
    chance to put in my serial number – get that error message after I download
    the exe.    Tried to copy page – I would select the correct file
    Welcome TechSoup Customer of TechSoup Global!
    Product Download
    Adobe Photoshop Elements and Premiere Elements 12.0 for Windows (English)
    *      <javascript:void(0)> Files
    <javascript:itralib_popup('dload_serialNum?item_key=5001111&plne=101791&cert
    Num=135338281','info','560','400')> PAC, Serial Numbers & Credential Files
    <https://adobe.subscribenet.com/control/adbe/certdlog?plne=101791&item_key=5
    001111> Download Log
    <https://adobe.subscribenet.com/control/adbe/certnotes?plne=101791&item_key=
    5001111> Notes
    *      <javascript:itralib_popup('downloadpagehelp','EULA','495','600')>
    Download Help
    Adobe recommends you use the Akamai Download Manager for large files. You
    can enable the download manager by clicking on the Download Preferences link
    to the left. If you are using Microsoft Internet Explorer as your browser,
    then the HTTP option will not work for files larger than 4GB due to the
    browser’s download size limit.
    If there are multiple files for your products, please be sure to download
    ALL files prior to attempting to install.
    The software you are about to download is subject to export control laws and
    regulations. By downloading this software, you agree that you will not
    knowingly, without prior written authorization from the competent government
    authorities, export or reexport - directly or indirectly - any software
    downloaded from this website to any prohibited destination, end-user, or
    end-use.
    Note: All Adobe products require a serial number for installation. If you
    are having difficulty with the serial number, please
    <https://adobe.subscribenet.com/control/adbe/manualsupport> contact us.
    *      6 Files
    Top of Form
    Select All
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111&orderB
    y=ORDER_BY_DESCRIPTION&ascending=true> File Description
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111&orderB
    y=ORDER_BY_FILE_SIZE&ascending=true> File Size
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111&orderB
    y=ORDER_BY_FILE_NAME&ascending=true> File Name
    The download limit for this file has been reached
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    Expand All / Collapse All
    Adobe Photoshop Elements 12.0 for Windows 32 bit Installer (English, German,
    French, Japanese)
    1.5 MB
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    PhotoshopElements_12_WWEFDJ.exe
    The download limit for this file has been reached
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    Expand All / Collapse All
    Adobe Photoshop Elements 12.0 for Windows 32 bit Installer Package (English,
    German, French, Japanese)
    1.1 GB
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    PhotoshopElements_12_WWEFDJ.7z
    The download limit for this file has been reached
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    Expand All / Collapse All
    Adobe Premiere Elements 12.0 for Windows 32 bit Installer (English, German,
    French, Japanese)
    1.5 MB
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    PremiereElements_12_WWEFDJ_win32.exe
    The download limit for this file has been reached
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    Expand All / Collapse All
    Adobe Premiere Elements 12.0 for Windows 32 bit Installer Package (English,
    German, French, Japanese)
    1.1 GB
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    PremiereElements_12_WWEFDJ_win32.7z
    The download limit for this file has been reached
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    Expand All / Collapse All
    Adobe Premiere Elements 12.0 for Windows 64 bit Installer (English, German,
    French, Japanese)
    1.5 MB
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    PremiereElements_12_WWEFDJ_win64.exe
    The download limit for this file has been reached
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    Expand All / Collapse All
    Adobe Premiere Elements 12.0 for Windows 64 bit Installer Package (English,
    German, French, Japanese)
    1.2 GB
    <https://adobe.subscribenet.com/control/adbe/download?element=5001111>
    PremiereElements_12_WWEFDJ_win64.7z
    Bottom of Form

  • Files pulling from same folder show up differently when uploaded to my site

    When I publish my html files on Adobe muse and I launch them from my file folder, they look great, but when I try to access them from my domain, the images are skewed and it looks awful but it is being pulled from the same location.
    I have published this site many times before and never had this problem.
    What is going wrong?

    I upgraded to the latest Muse version and after I republished I did not have a problem, maybe my computer was no longer compatible with the old one?
    In any event, it is working now. Thank you for your quick response. I appreciate it very much
    Casey Coughlin

  • Why do most of my stacks come ungrouped when I make changes to other files in the same folder?

    I have a folder of about 3000 graphics and photos that I use for work. I've meticulously organized them all by using unique file names, keywords, and sorting. However, when I make changes to a set of files (especially using the batch rename tool), a large percentage, even a majority, of the other stacks in the folder come ungrouped.
    This has been happening to me for several months, and so far I can't see any type of order or factor that makes certain files come ungrouped. Many times, it's the same files that come ungrouped, but in addition to those, there will be other random stacks that I lose. My stacks are only a few files big (each stack is comprised of the same picture in different file types) and with how many files I have, this has become seriously detrimental to my workflow and efficiency. Anywhere from 20-70 stacks will become ungrouped. I almost always have my files sorted by filename, and when I rename files using batch rename, I give them such similar names that I'd think there would be no reason for the rest of my files to come ungrouped. For example, if there are three files I want to group, I will give them a name like background_001, background_002, and background_003. After I do this, I'll discover that my stacks with names like template_(sequence number) and UI_(sequence number) have come ungrouped. It will do this with pages and pages of stacks at the same time, regardless of how I have the files / stacks sorted. It doesn't happen everytime I rename a batch, either. I just created 10 batches of 3 like-named files each, and after this last batch, about a hundred files came ungrouped.
    I understand that doing things like changing the sorting method of files, or renaming a file so that it's thrown in the middle of a stack, will ungroup my stacks. I don't think I'm doing any of these things (I've been trying desperately to make sure I don't change the sorting method of my files or do anything to a file that might have an effect like this). I don't use ratings or color labels in these folders, the only tools I use are batch rename, keywords, and stacks.
    Is there any way to preserve my stacks so this stops happening in the future, or I can correct it when it does?

    This is my first time posting here, so I'm sorry, I re-read my post several times and honestly did think I provided enough information, but you're right, it wasn't the right kind. So please (continue to) bear with me, I'm really not trying to be ignorant. I honestly assumed the issue was something I was doing wrong in Bridge, nothing to do with my computer specs.
    I am using a late-2008 Macbook, running Yosemite 10.1.1 (screenshot below)
    On the Mac I am using Bridge CC 6.1.1.115 and Photoshop CC 2014 (2014.2.1 release, 20141014.r.257 x64)
    Here is a link to the System Info from Photoshop on the Mac
    Here is a screenshot of my System Overview on the Mac
    Here is a screenshot of my Photoshop performance preferences on the Mac
    I am also using a Dell desktop with Windows 8, running Photoshop CC 2014 (2014.2.1 release, 20141014.r.257 x32) and Bridge CC 6.1.0.116 x32 (on a separate CC account with separate files that I don't try to sync or anything)
    Here is a link to the System Info from Photoshop on the Windows computer.
    Here is a screenshot of the system overview on the Windows
    Here is a screenshot of my Photoshop Performance preferences on the Windows computer
    I work with jpg, psd, ai, svg, and pdf files. Most of my stacks are three different file types of the same image, usually jpg, psd/ai, and pdf.
    I have not recieved any error messages
    I am not having issues opening raw files, I am not having printing issues, I have listed the troubleshooting steps I have taken.
    Is there any information you need that I missed? I'm trying not to be a dingus, but I'll have to ask you to be patient with me in the meantime. I haven't ever looked up half the hardware/software details that were suggested and I don't know how to off the top of my head, so I provided what I already knew how to

  • How can I batch move files to the same folder structure in a different location?

    Hi,
    I recently had an issue with my iTunes Library so I used the Organize Library feature to have iTunes organise my library.  What happened was that it put all of my music in a folder called 'Music' on my external hard drive, whereas previously it was not in a folder at all, e.g.
    BEFORE: External Hard Drive / Abba / Greatest Hits / Mama Mia.m4a
    AFTER: External Hard Drive / Music / Abba / Greatest Hits / Mama Mia.m4a
    I don't have any particular issue with the updated folder structure, except that I had copies of the artwork for each album in my album folders, and these weren't moved when the audio files were moved/consolidated/organised.  So I need to find a way of moving all of the artwork to the new folders, e.g.
    External Hard Drive / Abba / Greatest Hits / folder.jpg
    needs to become:
    External Hard Drive / Music / Abba / Greatest Hits / folder.jpg
    I have to do this for 3,000+ albums, and I have multiple artwork files for some albums, so I am hoping that there is a way of doing this using a batch/automated method of some kind, but I haven't been able to turn up anything yet.
    Can someone help with this?
    Thanks,
    Nick

    You can make a smart playlist containing episodes of both series and play from that. Podcasts are linked together by the URL they are served from so merging ongoing series isn't really practical.
    tt2

  • How to exclude two kind of files in the same folder in sender cc?

    Hi,gurus:
    Now we are using "advanced selection for source files" in sender file adapter.
    Our requirement is as below:
    The source directory is  c:\test and there are many files in the directory.
    We want to transfer all the files except aa.txt and bb.txt.
    We have to implement it in one scenario,but it couldn't work.
    It worked only when we transferred all the files except aa.txt or bb.txt,but not work when we want to transfer except aatxt and bb.txt.
    I checked the blog "XI/PI: how to exclude files in a sender File adapter?",but it is not the same issue.
    Any help will be appreciated.

    Hi,
    The only way to solve your purpose is
    Provide the list of file names like c. d. e. f. whatever possible number of file names in the "File Name Mask" column and provide the directory names by clicking on plus for additional rows. just dont use aa.* and bb. anywhere.This will do your purpose.
    Thanks!

  • Referencing a file in the same folder as my programs jar.

    I have some images that my application uses and am having a very hard time figuring out how to best reference them. I want it so that my program can be anywhere on the HD as long as it's in one folder. The problem with this is that when I try and reference my images using just the image name, it seems to assume that the user is starting from their home directory. I need a way to make a relative reference to the images in the same directory as my program.
    Any ideas?

    I have tried this but not in the same way you are
    saying to. Any better examples on doing that? That
    documentation is a bit cryptic to me (a new
    programmer in java).Here's a Sun tutorial. It rocks:
    http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html
    This post might help.
    http://forum.java.sun.com/thread.jspa?threadID=749816&messageID=4287812
    Sorry about the Netbeans thing, I've never used it.

  • Replacing an updated page in multiple files in the same folder

    I have a large number of files of 5 pages long with some of the pages being the same.  There comes a time when information on some of these pages has to be up-dated.
    I want to know if there is a fast way of exchanging a page in all these files without having to open them all and then replacing the page with the up-dated copy.

    In your version it's available under the Advanced menu, Document Processing. It was called Batch Sequences before being renamed to Actions. Look there and you should find it...

  • What is the recommended tool to convert all of my email and their attachments in one stroke to pdf files in the same folder structure that emails are stored in

    I have thousands of emails creatively stored in a host of sub folders. I would like to see if anyone knows of a tool that I can point at TB and convert all of my files into a similar file structure with the attachments embedded into the emails. I don't want much I realize. I bet there is a tool out there that will get me close.

    I don't know of a way to produce pdfs in a simple way (probably with a pdf printer driver), but if you export or save messages as eml files, the attachments are embedded in the emls, and emls can be read by most email programs. Besides saving through Ctrl-S, exporting complex folders to eml format is probably best done with [https://addons.mozilla.org/en-us/thunderbird/addon/importexporttools/ ImportExportTools].

  • Different Approvers for files in the same folder

    Dear All,
    We have developed a Webdynpro Application for uploading documents to specific Folders in KM and set the permission to the newly uploaded documents based on the selection given by the user at the time of upload.
    We are doing enhancements to this application. We want to add time based publishing and approval process.
    Time based publishing is working fine. There is a problem with approval process.
    We have n branches. If a user from Branch 1 uploads a document, the approval request should go to the approver for that respective branch. Documents related to all branches are in one folder and access is controlled through permissions.
    [Related thread|https://forums.sdn.sap.com/thread.jspa?threadID=1361070]
    In this thread reply from Detlev says that using API we can set resource level approvers. I'm not able to do that. I managed to change the permission only at folder level.
    Please help me in Solving this problem.
    Warm Regards,
    Aparnna

    IGroup approverGroup =
                   WPUMFactory.getGroupFactory().getGroup(wdContext.currentContextElement().getApproverGroup());
    ICollection byCompanyFolder = (ICollection) resource;
    IRepositoryServiceFactory repServiceFactory = ResourceFactory.getInstance().getServiceFactory();
    IStatemanagementManager stateMgr =
         (IStatemanagementManager) repServiceFactory.getRepositoryService(
              byCompanyFolder,
              "StatemanagementRepositoryService");
    IStatemanagementResource statRsrc = stateMgr.getStatemangementResource(byCompanyFolder);
    IStatemanagementUtilsResource statRsrcUtils = statRsrc.getUtils();
    statRsrcUtils.setStatemanagementEnabled(false);
    statRsrcUtils.setStatemanagementEnabled(true);
    IStepList stepList = statRsrcUtils.readApproverList();
    stepList.insertStep(0);
    stepList.setStepSelected(0, true);
    stepList.setStepDisplayName(0, wdContext.currentContextElement().getStepName());
    stepList.addApproverToSelectedStep(approverGroup, 0);
    //stepList.addApproverToSelectedStep(approverUser, 0);
    statRsrcUtils.saveApproverList(stepList);
    wdComponentAPI.getMessageManager().reportSuccess("Workflow setup for the folder :" + resource.getRID());
    Regards
    BP

Maybe you are looking for

  • Help! How to share iPhoto pictures between users on same computer

    This has probably been posted before. If so, I appologize. My wife and I have seperate log ins and she can't see any of the photos we've imported on my log-in. Is there a neutal folder or user priveledge I need to set? I've tried everything I can thi

  • Creating Lock object for a field in a sap table

    Hi ,        I need to lock a field in sap table eg.  To lock a Standard price(stprs) field in Material Valuation (mbew) table.

  • ISA B2B access problem

    Dear All, we use the ISA 4.0 SP10 B2B hosted on the SAP Web-AS 6.20 PatchLevel 103149.20. The web shop was installed and configured by another company beforehand. Unfortunately I have undeployed all web-apps via the Deploy Tool by accident. This is t

  • Sharing photos through email

    I run Windows XP and use msn for email.  I have Photoshop Elements 7 and when I try to share photos my computer defaults to verizon e-mail.  How can I change this so that I can use my contact list I have in my msn account?

  • Seem to have lost itunes in my browser in imovies.

    Seem to have lost itunes in my browser in imovies. I can access my itunes library but cannot access the itune store. The itune icon is the list but i cannot open it. I'm pretty new to all this so please if anybody can help i would be grateful. Also y