Want to edit just one word in car file how to edit it in wso2 - api

I have made a car file and just want to change one word in one of the multiple sequences. Any way I can edit it save it and redeploy it without making an entire project for that car file.
Any leads would mean a lot.
Thanks

You can do as follows.
Rename the .car file to a zip.
Unzip the file
Change relevant files.
Zip the artifacts.
Rename to car extension.

Car files are .zip archives. If you are on linux, the easiest way to do it is to use a tool like vim. First, change the extension of the car file to .zip and then use vim to update the files interactively, then change the extension back. Example commands below.
mv carFileName.car carFileName.zip
vim carFileName.zip
mv carFileName.zip carFileName.car

Related

Is there an easy way to move a file to a different folder in dbt Cloud?

Is there an easy way to move a file to a different folder in dbt Cloud, without having to create a new file of the same name in the new folder, copy/paste from the old file, and delete the old file, which is a pain.
Is there a good reason I should NOT do this? I assume my refs still work as long as the filename remains the same, and I don't have any specific folder logic tied to this file.
For example, say I have my_model.sql in my 'staging' folder and I want to simply move it to my 'mart' folder instead. In this example I'd like to do this to reflect that my file is really a more 'stable' mart-type table file vs a staging view. I realize I can just change the materialization type, but I'm doing this more to organize things clearly. Thanks!
The way to move a file in the cloud IDE for dbt is not 100% obvious. You can use the rename function to move a file to another location.
Click on the drop down next to the file name, then select "Rename." That will open a file path and you can change where the file lives from there by typing in the new folder's name.
The easiest way I have found to do this is...not using DBT Cloud, but using github desktop (no command line needed).
Create a new branch
Open repository in github
View files in your file explorer
Move files or directory locally
Upload to github
Push to origin for the branch you created
Open a pull request
Merge
Depending on what the file or directory is you may find the creating a new branch and opening PR to be overkill. For my specific project there is a lot of legacy organization and models that we aren't totally sure don't have downstream dependencies, so creating a new branch for this allowed me to test run all of our models.
Hope this helps!

test .zip/.7z/.rar if archive is bad, add prefix to file name bad_ and move to another folder

I have quite a few archives that I need to test.
Archives are in parent folders with many sub folders.
I am a Windows 10/11 user.
I have used 7z file manager easy enough, checks a folder for me and reports all good except for xx failed.
Then I have to manually hunt for the failed archive and move it somewhere to look at it at a later date for repair if possible or deletion.
What I would like to know if possible to do the following.
Test the archives .zip/.7z/.rar
If archive is bad, add prefix to file name bad_
Move bad_ archive to another folder.
Then I can make plans for the moved files repair or delete.
cheers.

How to unzip the same zip file multiple times?

I am developing a zip extractor app for which if i unzip multiple times the same zip file it should extract like myfile-1, myfile-2, myfile-3 something like this .
example : there is sampleproject.zip in my desktop when i unzip it should be like sampleproject, sampleproject-1, sampleproject-2.
Any Suggestions.
Thanks in Advance!
Based on your comment I suggest you unzip your file to a temporary directory and then move its contents into the actual directory, handling any name clashes as you do that. In outline:
Use URLForDirectory:inDomain:appropriateForURL:create:error: to create a temporary directory suitable to unzip into. You should pass your the URL of your destinationPath for the appropriateForURL: parameter; this should give you a temporary directory on the same volume as destinationPath making placing the unzipped items into the right place moves rather than copies.
Unzip into the temporary directory returned by (1)
Now use NSFileManager calls to traverse the temporary directory moving each item found to destinationPath, renaming as needed to avoid name clashes.
Remove the temporary directory.
If you have problems implementing this algorithm ask a new question, show your code, explain your problem, and include a link back to this question so the thread can be followed. Someone will then undoubtedly help you with the next step.
HTH

Get overridden file data?

I have a script file. Unfortunately I've overridden it with some other data. I need the old data. crtl+Z is not working.
How do I recover it?
unfortunately some editors are not supporting of crtl + Z so only not able to recover the data..
are you using file versioning? what OS, what version?
What is the File structure? NTFS?
if you overwrite a file in NTFS it tends to delete the first file and put in the second, not systematically destroy the file (so you can recover the file with an undelete utility.
first, rename the current file, then open an undelete utility (you don't want to download anything to this computer as you may overwrite the file.)
run it from a memory stick.
the safest thing to do if it's critical is to image the device off to a donor scratch media and work from there.

use Archive Utility.app from command line (or with applescript)

I would like to use Archive Utility.app in an app I'm writing to compress one or more files.
Doing (from the command line):
/System/Library/CoreServices/Archive\ Utility.app/Contents/MacOS/Archive\ Utility file_to_zip
Does work but it creates a cpgz file, I could live with that (even though .zip would be better) but the main problem is that I am not able to compress 2 files into 1 archive:
/System/Library/CoreServices/Archive\ Utility.app/Contents/MacOS/Archive\ Utility ~/foo/a.txt ~/bar/b.txt
The above command will create 2 archives (~/foo/a.txt.cpgz and ~/bar/b.txt.cpgz).
I cannot get this to do what I want either:
open -a /System/Library/CoreServices/Archive\ Utility.app --args xxxx
I'd rather not use the zip command because the files that are to be compressed are rather large so it would be neat to have the built in progress bar.
Or, could I use Archive Utility programmatically?
Thanks.
Archive Utility.app uses the following to create its zip archives:
ditto -c -k --sequesterRsrc --keepParent Product.app Product.app.zip
Archive Utility.app isn't scriptable.
The -dd/--display-dots option will cause the command-line zip utility to displays progress dots when compressing. You could parse the output of zip for your progress bar. zip will also display dots if it takes more than five seconds to scan and open files.
Better would be to integrate a compression library, such as zlib or libbzip2. Both of those let you compress a portion of the data at a time. You'll need to handle progress bar updates, which you can do after compressing each block of data.
How about Automator? The "Create Archive" action would work.
I have used Archive Utility to decompress files from Applescripts:
tell application "Archive Utility" to open filePath
However, this only tells Archive Utility to start decompressing. It will complete in its own time and the applescript will continue to execute without waiting for the decompression to finish. Archive Utility will not tell the applescript when it is done.
You can use the above line if Archive Utility is already running. It will add the new file to its queue and decompress when ready.
Also, Archive Utility's preferences will control how it accomplishes the goal. For example: it might decompress to a different folder or delete the original. You can run it as a program and change the preferences if that helps.
I have not used this to get Archive Utility to compress files.