added argument for disallowing config relative paths

This commit is contained in:
fros4943 2010-06-11 09:10:52 +00:00
parent 419906a769
commit b540408add

View File

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: GUI.java,v 1.169 2010/05/19 17:32:54 fros4943 Exp $ * $Id: GUI.java,v 1.170 2010/06/11 09:10:52 fros4943 Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
@ -3978,6 +3978,10 @@ public class GUI extends Observable {
* @return Portable file, or original file is conversion failed * @return Portable file, or original file is conversion failed
*/ */
public File createPortablePath(File file) { public File createPortablePath(File file) {
return createPortablePath(file, true);
}
public File createPortablePath(File file, boolean allowConfigRelativePaths) {
File portable = null; File portable = null;
portable = createContikiRelativePath(file); portable = createContikiRelativePath(file);
@ -3986,10 +3990,12 @@ public class GUI extends Observable {
return portable; return portable;
} }
portable = createConfigRelativePath(file); if (allowConfigRelativePaths) {
if (portable != null) { portable = createConfigRelativePath(file);
/*logger.info("Generated config relative path '" + file.getPath() + "' to '" + portable.getPath() + "'");*/ if (portable != null) {
return portable; /*logger.info("Generated config relative path '" + file.getPath() + "' to '" + portable.getPath() + "'");*/
return portable;
}
} }
logger.warn("Path is not portable: '" + file.getPath()); logger.warn("Path is not portable: '" + file.getPath());