write in a txt file in the /res folder

At the start of the application, I read a text from the folder /res file using:

InputStream is = this.getClass().getResourceAsStream("/myfile.txt");

How can I write back to the same file?

I've seen many examples explaining how to write a file, but I wonder what would be the path to update a file which is depolyed with cod in the /res folder.

Background information:

  • The file contains the default configuration for the application.
  • When the application starts, it reads in memory.
  • The app then made HTTP call to get the configuration changes we've made since the last time it was opened.
  • I want to save these changes to the file so it picks up them there the next time that the application starts instead forcing him to shoot from the web every time.

Confirmed.

Tags: BlackBerry Developers

Similar Questions

  • How to read/write tdms 2.0 files with the TDM C DLL?

    Hello

    How to read/write tdms 2.0 files with the TDM C DLL?

    How consequently the datas in interlaced with the TDM C DLL mode?

    Thank you

    Confirmation: TDM C DLL always wrote the file in TDMS version 2.0.

  • I found a .txt file in the directory "DriverCure" that says "Called destructive Backend." What is c?

    I am running XP SP3 and I found a .txt file in the directory "DriverCure" that says "Called destructive Backend." What is c?

    ParetoLogic DriverCure is a computer program that scans all the drivers on your hard drive and compiles a list of those that are available updates.

    Checks the internet for the DriverCure files removal tools.

    Thank you

  • CANNOT write to files in the shared folder of XP on a PC running windows 7 - but good vice versa

    I have a laptop under Windows 7 (SP1) and a desktop running XP (SP3).  I have connected both via a wireless network. While I can see and access shared files/folders from one computer to the other computer, I can only read/write files in the shared folder on the portable computer that is running Windows 7.

    If I try and change a file in the shared folder from the PC under XP on my laptop, I get the message "this file is set to read-only. Try again with a different name "."  I know that the file is NOT checked for read-only. When I change the name of the file I get the error message "\\Desktop\SharedDocs\filename.doc you are not allowed to save in this location. Contact the administrator for approval.  You want to save in the folder my documents instead? "If I save the file to another location on the laptop under Win7 it save then OK.  I can not just save a modified version of the file in the same shared folder from desktop running XP.
    It seems that it must be something to do with permissions and access to the parameters of the desktop running XP but I can not find these. Fairly easy to find in Windows 7.
    Finally, I don't have a login/password set for the connection to the computer to Office XP.  I don't have a user name and password for the laptop Win7 but you have turned off password protected sharing.
    Anyone have a solution to this?
    Thank you

    OK - the problem is now resolved.

    I noticed that the read-only for the shared folder has been checked. When I unchecked it and also checked the box "allow network users to change my files" in the shared folder properties/sharing, I was able to modify and save files in the shared folder on my laptop.
    It's a little weird because I thought I had done this the other day where the results have been less successful.  Strange.
    Thanks for your help.

  • remove the error of write protect, transfer music files to the micro sd card

    remove the error of write protect, transfer music files to the micro sd card

    on micro SD card it self you have a little pass that you can move

  • Import a TXT file in the user dictionary

    Hi Forum,

    This is the script I m using import file txt in the "user dictionary", but the result is "undefined".

    Could someone help me how to import a Txt file in the user dictionary.

    var myUserDictionaries = app.userDictionaries;

    var myCountDict = myUserDictionaries.count ();

    myDoc var = app.activeDocument;

    myAddedWords = File("//Users/wleastudio/Desktop/AVIVA_dictionary.txt");

    for (var i = myCountDict-1; i > = 0; i--) {}

    myUserDictionary = myUserDictionaries [i];

    var myAddedWords = myUserDictionary.addedWords;

    myUserDictionary.addWord [myAddedWords];

    }

    Thank you

    Hello

    Try this example for the US English:

    var myUserDict = app.userDictionaries[21];//Should be English USA
    var txtFile = File('~/Desktop/test.txt');
    txtFile.open('r');
    wordsArray = txtFile.read().replace(/["'.,:;!?()\/\d\[\]]+/g, ' ').split(/\s+/);//cleaning the text to get only "words" mostly adapted by jongware
    txtFile.close();
    
        myUserDict.addWord(wordsArray)
    

    So long

  • How can I move files to the system folder?

    Hi all

    I was wondering how to move files to the system folder. With the update to El Capitan and the former program is no longer works and the developer suggests moving some files on the system folder that should fix it, but even if an administrator account I don't have write access to the system-> library folder where they need to go. Any help would be appreciated.

    Thank you!

    Steve

    In short: you do not have. The folder/System is only for Apple.  The new protections in El Capitan make it impossible for you to place the files.

    This is what the folder/library for: install additional components to the system, but keeping them separated from the basic installation.

    What software are you trying to run? What files we told you to move? I'm curious to know what type of developer will tell you to put the files in / System.

  • Is it possible to synchronize the copied file in the local folder with the original file in the network?

    Hello

    I copied a file from the shared network folder and it is really important document, so I need to use this file as a file off the local drive connection and backup as well just in case where the cause accidental, but I don't want to save it each time and don't want to use the original file in the network.

    Is it possible to automatically synchronize the copied file in the local folder with the original file in the network?

    Thank you

    Absolutely without interruption would require a program to write that monitors files on the file locks and triggers a sync as soon as he sees a change.  So, since we cannot just write a program, the best thing is either:

    (1) an icon on your desktop that you can click each time you want to synchronize "synchronize my files now.

    or

    (2) plan the "my sync files' to run automatically every x minutes.  It could be a batch script that checks to see if the file is more recent and copies only files that have changed.  Although perhaps a little aggressive, you could plan this thing check-and-copy-a batch file - again to run every 60 seconds.

    Batch files allow you to control the operations very directly, but Microsoft has also made a (not supported) tool called SyncToy who does all the same things, but has a graphical interface to select your options. It can be programmed to run automatically on a schedule.

  • Cannot create a .db file in the assets folder

    I am trying to create a quizz.db file in the current folder by creating first a temporary quizz.db in the folder data and then creating tables inside and then copy it in the current folder. By debugging code, it shows that the folder is created. But I can't find it in the current folder. Here is the code

    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::data;
    
    SQLTest::SQLTest(bb::cascades::Application *app): QObject(app)
    {
        const QString fileName = QString("quizz.db");
        QString dataFolder = QDir::homePath();
        QString newFileName = dataFolder + "/" + fileName;
        QTemporaryFile file(newFileName);
    
        // Open the file that was created
        if (file.open())
        {
            // Create an SqlDataAccess object
            SqlDataAccess sda(newFileName);
    
            // Create a table called Employee in the database file
            sda.execute("CREATE TABLE Employee( firstName VARCHAR(50),lastName VARCHAR(50), salary INT);");
    
            // Insert employee records into the table
            sda.execute("INSERT INTO Employee (firstName, lastName, salary) VALUES (\"Mike\", \"Chepesky\", 42000);");
            sda.execute("INSERT INTO Employee (firstName, lastName, salary) VALUES (\"Westlee\", \"Barichak\", 55000);");
            sda.execute("INSERT INTO Employee (firstName, lastName, salary) VALUES (\"Ian\", \"Dundas\", 47000);");
            if(sda.hasError())
            {
    
            }
            else
                copyFileToAssetsFolder("quizz.db");
        }
    }
    void SQLTest::copyFileToAssetsFolder(const QString fileName)
    {
        QString appFolder(QDir::homePath());
        appFolder.chop(4);
        QString originalFileName = appFolder + "app/native/assets/" + fileName;
        QFile newFile(originalFileName);
    // If I enable this `if` condition the code satisfies it and removes the quizz.db file and then it satisfies the next `if` condition and successfully copies the quizz.db file from `data` folder to `assets` folder.
        /*if(newFile.exists())
            QDir().remove(originalFileName);*/
        // this `if` condition is not satisfied. Which should mean the quizz.db file has been created on assets folder.
        if (!newFile.exists())
        {
            // If the file is not already in the assets folder, we copy it from the
            // data folder (read and write) to the assets folder (read only).
    
            QString dataFolder = QDir::homePath();
            QString newFileName = dataFolder + "/" + fileName;
            QFile originalFile(newFileName);
    
            if (originalFile.exists())
            {
                // Create sub folders if any creates the SQL folder for a file path like e.g. sql/quotesdb
                QFileInfo fileInfo(originalFileName);
                QDir().mkpath (fileInfo.dir().path());
    
                if(!originalFile.copy(originalFileName)) {
                    qDebug() << "Failed to copy file to path: " << originalFileName;
                }
            } else {
                qDebug() << "Failed to copy file data base file does not exists.";
            }
        }
    
       // mSourceInDataFolder = newFileName;
    }
    

    If activate the commented "If" condition of "copyFileToAssetsFolder" int he removes already created quizz.db file in the current folder (that Im unable to find) and goes inside the next ' if' and copy the quizz.db created on the folder "data" of active fodler. But in any case I don't find the quizz.db in the current folder. I really need help with this quickly. Thank you.

    Thanks to read this to learn why you can have an application change the assets folder: https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.d...

  • Is it possible to prevent or remedy to have too many files in the DCIM folder?

    Is it possible to prevent or remedy to have too many files in the DCIM folder?  In a group of friends, when you view folders DCIM iPhone in Windows 8, three of us have many, many files (such as 101APPLE, 327APPLE, 328APPLE).  Phones concerned: 5 c, 6: 6.  Some have only one photo per file, some files have just a few pictures.  In addition, two friends have files dated 1969.  I think everyone has the most current ioS. What is the cause and is at - it a way to overcome it?

    No, it isn't. The DCIM and its content was never for public use to shoot photos and videos.

    Here's the right way to go about it.

    Import photos and videos from your iPhone, iPad or iPod touch - Apple Support

    If you want something more specific Windows, I suggest you watch here.

    http://Windows.Microsoft.com/en-us/Windows-8/import-photos-videos

  • What is the file deleted the files in the main folder, and can / should I remove it?

    What is the file deleted the files in the main folder, and can / should I remove it? Is it too much room, I could use?

    This file stores a list of files from previous version of Firefox that are no longer needed or supported in the current version of Firefox. This file is only a few KB and it is best not to delete files in the Firefox program folder to avoid update problems. If the required files are missing or modified with a update Firefox will download the full version (approximately 10 MB) instead of a small incremental update which is usually only a few hundred KB.

  • Where the photos are normally stored on a Mac computer? In the folder images in the Finder on my Mac, I see a file called "Library.photoslibrary Photos" i.e. 28.52 GB but I also have about 160 other image files in the same folder. But in pictures,.

    Where the photos are normally stored on a Mac computer? In the folder images in the Finder on my Mac, I have a file named "Library.photoslibrary Photos" i.e. 28.52 gb and another folder called 'iPhoto Library.migratedphotolibrary' i.e. 4.95 GB, but then I have also on the 160 other photo and video files in the same folder. But in my Photos app, it says that I have 6 260 'elements '.

    The pictures that you have imported into the photo library are, by default, stored inside the package (not file) "Library.photoslibrary Photos" in your pictures folder. The 'iPhoto Library.migratedphotolibrary' package would contain photos that have been stored in your library, iPhoto at the time of the migration.

    The other files in the pictures folder are that: other files. Also, they can be in libraries if you imported and has not deleted the copies lying around in the images.

  • User should not be able to remove all the files in the shared folder

    Hi all

    I have a shared folder accessible to each user Department wise, now I don't want to leave one to delete all files in the shared folder

    Shared folder is created on the Server Windows server 2008

    Please suggest emergency

    --
    Kind regards
    Kalpesh

    Hello

     
    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.
     
     
    I hope this helps.
  • I have this spl55.tmp file in my Windows/temp folder. I have also several other "sp" name of files in the same folder. Where did they come from?

    I have this file in my Windows/temp folder. It is 9.8 MB. I have also several other "sp" name of files in the same folder. Where did they come from? Can I just delete them?

    Thank you

    Paul

    If I'm not mistaken reference you the files are temporary files from the print job, you made and can be deleted safely.

  • Shimgvw.dll file in the sys32 folder can be boggus

    Shimgvw.dll file in the sys32 folder can be boggus, no propertys tab, how to save file from another folder that has the legitimate Properties tab?

    Update security for Windows XP (KB2483185)
    Last published: 08/02/2011
    A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and take control. You can protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.

    This update downloads ok but fails to install, so I did a manual download and install, but when asked for the location of shimgvw.dll during installation and I point to the file in the sys32 folder the update fails, it seems, there are 3 versions of this file, but the System 32 folder isn 't legitimate because it does not appear info version or company. "

    What can I do?

    Q1: When you say Properties tab are actually referring to the Version tab, i.e. right click on the file, select Properties and no Version and summary tabs not only general tab?

    Q2: Did you check C:\Windows\System32|dllcache for shimgvw.dll? Should be the same version 6.0.2900.6072-429 KB Windows Picture and Fax Viewer-Application Extension

    . If folder dllcache a Version tab displays the above version number and Microsoft Corporation as the owner, then could cut and move of the System32 folder then vouscopiezetcollezle the dllcache to the System32 folder and try regsvr32 shimgvw.dll in the run > open: box. If registration is successful, try to manually update again.

    There is always the posibilty of the malware infection. Have you MSE working properly?

    Visit the Microsoft Solution Center and antivirus security for resources and tools to keep your PC safe and healthy. If you have problems with the installation of the update itself, visit the Microsoft Update Support for resources and tools to keep your PC updated with the latest updates.

    I hope this helps.

Maybe you are looking for

  • iOS 9.3.4 question Bluetooth Car Kit

    Bluetooth connection with car BMW kit is unusable after upgrade.  Have disabled connections and reset but some problem. Nobody did test this in the lab? When will it grind? Device is an iPhone 6.

  • Firmware version 1.5 status report

    Can someone provide an indication when the F3 1.5 firmware will be available? -Andrew

  • Satellite L350-203: unknown devices after installing Win XP

    Hi all I havve a L350-203. The problem is he wandered, and someone erased the hard drive. I have the OEM XP Pro disc (I have it retrofit on Vista for networking) but the drive of Toshiba systems is missing with all the drivers of motherboard on the s

  • Satellite P205-S6307 drivers

    Hello.I want to download drivers for my satellite P205-S6307, but I can't find anywhere in the toshiba web site.My model is not listed in select it your laptopPlease could someone post the link to where I can download the drivers. I am running vista

  • communication of 64-bit application with 32-bit application on a PC?

    In a project of image processing, we started using x 64 LabVIEW to meet our need expanded memory. However, in order to communicate with the production plant is integrated in the machine, we wanted to use a Profibus DP - COMSOFT PCI card, which is a n