Skip to content

Commit

Permalink
Work around path escape bug
Browse files Browse the repository at this point in the history
Signed-off-by: bilux <[email protected]>
  • Loading branch information
ibilux committed May 6, 2020
1 parent f81af74 commit bf21597
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 95 deletions.
182 changes: 92 additions & 90 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- jar
- execution
- debugging
- javadoc
- test compilation
- test execution
- test debugging
- applet
- cleanup
- initialization
- compilation
- jar
- execution
- debugging
- javadoc
- test compilation
- test execution
- test debugging
- applet
- cleanup
-->
-->
<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="MobyDroid-impl">
<fail message="Please build using Ant 1.8.0 or higher.">
<condition>
Expand All @@ -29,10 +29,10 @@ is divided into following sections:
</fail>
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
<!--
======================
INITIALIZATION SECTION
======================
-->
======================
INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
Expand Down Expand Up @@ -154,18 +154,6 @@ is divided into following sections:
<istrue value="${not.archive.disabled}"/>
</or>
</condition>
<condition property="do.mkdist">
<and>
<isset property="do.archive"/>
<isset property="libs.CopyLibs.classpath"/>
<not>
<istrue value="${mkdist.disabled}"/>
</not>
<not>
<istrue value="${modules.supported.internal}"/>
</not>
</and>
</condition>
<condition property="do.archive+manifest.available">
<and>
<isset property="manifest.available"/>
Expand Down Expand Up @@ -798,8 +786,8 @@ is divided into following sections:
</target>
<target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
<!--
pre NB7.2 profiling section; consider it deprecated
-->
pre NB7.2 profiling section; consider it deprecated
-->
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
<target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
<!-- Empty placeholder for easier customization. -->
Expand Down Expand Up @@ -846,8 +834,8 @@ is divided into following sections:
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
</target>
<!--
end of pre NB7.2 profiling section
-->
end of pre NB7.2 profiling section
-->
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${main.class}" name="name"/>
Expand Down Expand Up @@ -1060,10 +1048,10 @@ is divided into following sections:
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
<!--
===================
COMPILATION SECTION
===================
-->
===================
COMPILATION SECTION
===================
-->
<target name="-deps-jar-init" unless="built-jar.properties">
<property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
<delete file="${built-jar.properties}" quiet="true"/>
Expand Down Expand Up @@ -1136,10 +1124,10 @@ is divided into following sections:
</target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
<!--
====================
JAR BUILDING SECTION
====================
-->
====================
JAR BUILDING SECTION
====================
-->
<target depends="init" name="-pre-pre-jar">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
Expand Down Expand Up @@ -1193,13 +1181,27 @@ is divided into following sections:
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
</manifest>
</target>
<target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
<target depends="init,compile" name="-check-do-mkdist">
<condition property="do.mkdist">
<and>
<isset property="do.archive"/>
<isset property="libs.CopyLibs.classpath"/>
<not>
<istrue value="${mkdist.disabled}"/>
</not>
<not>
<available file="${build.classes.dir}/module-info.class"/>
</not>
</and>
</condition>
</target>
<target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
<j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
<echo level="info">To run this application from the command line without Ant, try:</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo level="info">java -jar "${dist.jar.resolved}"</echo>
</target>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
<j2seproject1:jar manifest="${tmp.manifest.file}"/>
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<property location="${dist.jar}" name="dist.jar.resolved"/>
Expand Down Expand Up @@ -1255,10 +1257,10 @@ is divided into following sections:
<target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
<target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
<!--
=================
DEPLOY SECTION
=================
-->
=================
DEPLOY SECTION
=================
-->
<target name="-pre-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
Expand Down Expand Up @@ -1320,10 +1322,10 @@ is divided into following sections:
</target>
<target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
<!--
=================
EXECUTION SECTION
=================
-->
=================
EXECUTION SECTION
=================
-->
<target depends="init,compile" description="Run a main class." name="run">
<j2seproject1:java>
<customize>
Expand All @@ -1343,10 +1345,10 @@ is divided into following sections:
<j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
</target>
<!--
=================
DEBUGGING SECTION
=================
-->
=================
DEBUGGING SECTION
=================
-->
<target depends="init" if="netbeans.home" name="-debug-start-debugger">
<j2seproject1:nbjpdastart name="${debug.class}"/>
</target>
Expand Down Expand Up @@ -1384,13 +1386,13 @@ is divided into following sections:
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
<!--
=================
PROFILING SECTION
=================
-->
=================
PROFILING SECTION
=================
-->
<!--
pre NB7.2 profiler integration
-->
pre NB7.2 profiler integration
-->
<target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
Expand Down Expand Up @@ -1443,8 +1445,8 @@ is divided into following sections:
</j2seproject3:junit>
</target>
<!--
end of pre NB72 profiling section
-->
end of pre NB72 profiling section
-->
<target if="netbeans.home" name="-profile-check">
<condition property="profiler.configured">
<or>
Expand Down Expand Up @@ -1479,10 +1481,10 @@ is divided into following sections:
<antcall target="run-applet"/>
</target>
<!--
===============
JAVADOC SECTION
===============
-->
===============
JAVADOC SECTION
===============
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
Expand Down Expand Up @@ -1530,10 +1532,10 @@ is divided into following sections:
</target>
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
<!--
=========================
TEST COMPILATION SECTION
=========================
-->
=========================
TEST COMPILATION SECTION
=========================
-->
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
<mkdir dir="${build.test.classes.dir}"/>
</target>
Expand Down Expand Up @@ -1629,10 +1631,10 @@ is divided into following sections:
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
<!--
=======================
TEST EXECUTION SECTION
=======================
-->
=======================
TEST EXECUTION SECTION
=======================
-->
<target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
</target>
Expand Down Expand Up @@ -1666,10 +1668,10 @@ is divided into following sections:
</target>
<target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
<!--
=======================
TEST DEBUGGING SECTION
=======================
-->
=======================
TEST DEBUGGING SECTION
=======================
-->
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
Expand All @@ -1689,10 +1691,10 @@ is divided into following sections:
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
<!--
=========================
APPLET EXECUTION SECTION
=========================
-->
=========================
APPLET EXECUTION SECTION
=========================
-->
<target depends="init,compile-single" name="run-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject1:java classname="sun.applet.AppletViewer">
Expand All @@ -1702,10 +1704,10 @@ is divided into following sections:
</j2seproject1:java>
</target>
<!--
=========================
APPLET DEBUGGING SECTION
=========================
-->
=========================
APPLET DEBUGGING SECTION
=========================
-->
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject3:debug classname="sun.applet.AppletViewer">
Expand All @@ -1716,10 +1718,10 @@ is divided into following sections:
</target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
<!--
===============
CLEANUP SECTION
===============
-->
===============
CLEANUP SECTION
===============
-->
<target name="-deps-clean-init" unless="built-clean.properties">
<property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
<delete file="${built-clean.properties}" quiet="true"/>
Expand Down
4 changes: 2 additions & 2 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ [email protected]
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=5dedc10b
nbproject/build-impl.xml.script.CRC32=ce55ebc0
nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.89.1.48
nbproject/build-impl.xml.script.CRC32=952c996a
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.94.0.48
12 changes: 11 additions & 1 deletion src/com/hq/mobydroid/gui/JPanel_FileBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class JPanel_FileBrowser extends javax.swing.JPanel {
private final FileBrowserAbstract fileBrowserAbstract;
private final ComboBoxAutoComplete comboBoxAutoComplete;
private String tableFilter;
private String jComboBox_Path_String;
// *************************************************************

/**
Expand Down Expand Up @@ -314,7 +315,7 @@ public Void doInBackground() {
} catch (InterruptedException ex) {
}*/
// get files list
List<MyFile> list = fileBrowserAbstract.goTo(path);
List<MyFile> list = fileBrowserAbstract.goTo(path.replace('\\', '/')); // work around path escape bug

// publish
list.forEach((file) -> {
Expand All @@ -338,6 +339,7 @@ protected void process(List<MyFile> list) {
protected void done() {
// set current path
jComboBox_Path.setSelectedItem(fileBrowserAbstract.getPath());
jComboBox_Path_String = fileBrowserAbstract.getPath();
// update combobox suggetion default model
comboBoxAutoComplete.updateDefaultModel();
// enable UI
Expand Down Expand Up @@ -664,6 +666,14 @@ public void keyReleased(KeyEvent ke) {
}
// get written newText
String newText = ((JTextField) ke.getSource()).getText();

// is it really changed?
if (newText.equals(jComboBox_Path_String)) {
return;
} else {
jComboBox_Path_String = newText;
}

// start working
if (newText.isEmpty()) {
// hide popup
Expand Down
2 changes: 1 addition & 1 deletion src/com/hq/mobydroid/gui/JPanel_Settings.form
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<Component id="jLabel_LogPathIcon" alignment="0" min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jTextField_LogPath" alignment="0" min="-2" pref="32" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="161" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/com/hq/mobydroid/gui/JPanel_Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(jLabel_LogPath, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel_LogPathIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField_LogPath, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(161, 161, 161))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents

Expand Down

0 comments on commit bf21597

Please sign in to comment.