Netbeans ignoring upload relative file path - netbeans

Netbeans has stopped uploading files using the relative file structure. No matter what I upload path settings I enter, it uploads only to the server root. How can I fix this?
The problem is just for one project; other projects using the same configuration are okay.
I compared the files in nbproject with a working project and there are no differences.
I changed the "upload directory" but it doesn't change where the file gets uploaded to
I deleted the project and
created it anew.
It seems to be simply ignoring the config.
On my local computer, the path is:
/MyNetbeans/Project
/Source Files
/folder1
/folder2
MyFile.php
/Include Path
/Remote Files
When I upload, it saves the file to
/folder2/MyFile.php
but it should save it to
/folder1/folder2/MyFile.php
Netbeans 12.0,
Windows 10
Any ideas for getting it to upload using the relative path?

SOLUTION: change the Sources folder in Project Properties.
From the Netbeans File menu > Project properties > under Categories select "Sources". Next to "Source folder:" click BROWSE. Navigate to the folder, higher or lower, in the local directory structure which matches the directory structure on the server > OK.
Upload the file and check the server to see where it was saved. Rinse, lather and repeat as necessary.

Related

Edit existing directory in eclipse

This might be a dumb question, but I have a project I am trying to edit a few files for and using eclipse 4.20.0 as an IDE.
When I try to import the directory in eclipse, it creates a completely separate eclipse workspace directory and stores the files in there for my editing. (When I make changes, files in the eclipse workspace directory are changed, but not the original directory)
Is there a way to open the original directory in Eclipse and edit files directly in there? Or am I going to have to work inside the directory eclipse created and then manually move the files over every time to test them again?
I swear I've done this before, but it's been a few years so I might just be importing the directory wrong.
If you are only making a couple changes, just clicking on the .java class you need in your explorer and "Open With... -> Eclipse IDE" will allow you to edit the specific file without opening up a new project. If you are trying to open the project and work on all the files at once, File > Open Projects from File System usually works pretty well on eclipse. If you are opening another eclipse project, just click on the folder where the .project is stored when opening, not necessarily clicking into the folder itself.

Viewing a modified file in eclipse

I was adding a simple file to one of my programs that updates when I run the program with a particular parameter.
The file updated fine, but it is stored in the /bin directory and I can't figure out how to view the file within the editor.
I can see that the file is updated when I traverse the bin folder manually and open it with notepad.
Is there a way to view the file within the editor?
edit: I have a file in the project already but I doesn't update, instead the copy in the bin folder does; Can I connect the two somehow?
Your <project>/bin directory is being filtered from view. Right click on your project, select Show In->Navigator then you should be able to see your /bin directory and double click your file to have it open in an editor.
Alternatively, you can use ctrl-shift-r to open the Open Resource dialog, from the triangle drop down menu check Show Derived Resources, and then type in the name of your file.
The /bin directory is managed by the Eclipse builders and so you may lose your file if you do a clean. I would suggest using a different directory to house your runtime files.

Netbeans: how to upload file into different folder?

I would like to upload a files in Netbeans, for example from: C:/my_folder in my computer into /home/public_html folder on the server. I've specified initial path as /home and upload directory as /public_html, and in the properties my path looks like this: sftp://host.name.com/home/public_html.
But when I upload files I find them in the /home/public_html/my_folder ... how to fix it? Because I've tried all options in the properties but still doesn't work.
You have to create a new project and set your project folder to C:/my_folder. Set your upload path to /home/public_html as you have.
Now, if you have a file C:/my_folder/x.html it will be uploaded to /home/public_html/x.html.
Here is a step by step instructions to upload files from Netbeans.
http://www.gridsandguides.com/blog/how-to-use-net-beans-to-edit-file-on-server

How to rename the folder name in xcode project with out corrupting the files

In my xcode project i have created a folder manually named "MyClasses" to place the newly added files/classes to this folder.
Now i have nearly 30 classes in this folder.
when i renamed this folder , all the files in this folder are gets Erased.
Now i need to rename the folder to "ViewControllerClasses".
But i lost 30 .h, .m, xib files. [lucky i have a copy & and zip file]
How to rename the folder with out corrupting the files.
Renamed it to myviewcontrollerclasswes
When i renamed
Two Solutions
Method_1. Try Manual editing:
« Drag your MedChart.xcodeproj to TextWrangler (or any text editor)
« Use find button to find "FolderName" (Your folder name)
« Replace all with new name.
« In some project you may notice header search path problem...goto header search path and replace with new name.
Method_2. Use Xcode to choose base folder:
Rename folder in finder then use Xcode to choose same folder.
NOTE as of 2017:
Now Xcode 9 synchronises the folder and the project hierarchy automatically.
NOTE as of 2013:
Duplicate and rename Xcode project & associated folders
The "folders" what you see in XCode under your project file are not real folders in the file system, only virtual folders administered in the .xcodeproj file. You can organize your files in the project folder independently from their location in the file system. Some prefers to map the file system folder structure inside the project folder structure, some others store all source files in one big folder in the file system and organize them only in the project folders: it's rather a question of preference.
However if you rename/move physically the files in the file system, you will have to delete and re-add them to your project since XCode will not know where to find them. Pay attention not to delete them physically only remove them from XCode project, then re-add them and reorganize as you want.
One more thing to note: if you are using version control system you will have to inform also its client (svn or git most likely) that you have renamed/moved your files. If you want to keep file revision history it will be a good idea to issue the copy/move command explicitly to the version control otherwise it will treat your files as deleted from the old location and added as new in the new location.
In case anyone is still having trouble with this:
Select the folder or file in the left-side bar of XCode corresponding to the folder you want to rename (for me I renamed the folder containing all my files so I selected the topmost folder)
On the right-side bar, below where it says 'Location', click the folder icon.
In the file explorer that opens up rename the existing folder to whatever name you'd like it to be, then afterwards select it and press 'Ok'.
XCode should update the file locations accordingly.
Keep in mind that if you rename something which contains a file that is hard-coded as a certain path in your build settings, XCode will throw an error. You'll have to manually change those paths in your build settings.
This worked for me, hope it works for you too.
You should just run a search and replace on the project file (if you are working with version control and with other developers you will have seen this file a lot without a doubt), it's the project.pbxproj file located inside the xxxxxxxx.xcodeproj file.
Just right click (Control + Click) on the file and select "Show Package Contents" to find the xcodeproj file.
I still find it easier than all these methods to simply create a new folder in your file navigator and then drag your files from the other folder into it. Sometimes the simplest way is the best way. It literally takes me 10 seconds and I don't need to leave Xcode.

netbeans ftp configuration

I've set up my FTP connection for my project, but when it uploads the file, it adds a directory named after the project to the uploads (which means it isn't going to the right folder).
i.e.
initial directory set to '/httpdocs';
no upload directory specified.
I upload a file from my local folder:
project name/library/script.php
I want it to go here:
FTP/httpdocs/library/script.php
but it's going here:
FTP/httpdocs/PROJECTNAME/library/script.php
Can anyone help me get this configured correctly?
Then you are making your project in netbeans one folder too high. The project should be created with the main folder being the root folder, not the folder that holds the root folder (the one with the name of the folder).
So, you need to recreate your project with the correct folder being the root folder, and you should be all set.