You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pushing a file from python client, cytomine core : RestSoftwareController.groovy is failing at the following code. parent directory with softare,id should be tested whether or not directory, if it is not, it should go ahead to make directory and then move to create a file. Currently, it is trying to create file and then checking the parent directory, so it is destined to fail if the directory does not exist upon file creation.
String sourcePath = software.id+"/"+filename
File source = new File((grailsApplication.config.cytomine.software.path.softwareSources as String)+"/"+sourcePath)
if(!source.parentFile.exists()) source.parentFile.mkdir()
f.transferTo(source)
The text was updated successfully, but these errors were encountered:
The File object "source" is only instantiated at the line 2.
In Java, you can create a File object even if the associated path doesn't exists. It will not try to create the file on your filesystem.
So, we check if the parentDirectory exists before creating the file with the line f.transferTo(source)
However, the softwareSources parameter is not into the bootstrap repository, so its default value is "/data/softwares/code"
I will fix this into the bootstrap repository because it can be the origin of some problems.
pushing a file from python client, cytomine core : RestSoftwareController.groovy is failing at the following code. parent directory with softare,id should be tested whether or not directory, if it is not, it should go ahead to make directory and then move to create a file. Currently, it is trying to create file and then checking the parent directory, so it is destined to fail if the directory does not exist upon file creation.
The text was updated successfully, but these errors were encountered: