luc 9 years ago
commit 41767a01c2

@ -103,11 +103,11 @@ public class Status
redirect = true;
} else if ( post.containsKey("popup") ) {
final boolean trigger_enabled = post.getBoolean("popup");
sb.setConfig("browserPopUpTrigger", trigger_enabled);
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, trigger_enabled);
redirect = true;
} else if ( post.containsKey("tray") ) {
final boolean trigger_enabled = post.getBoolean("tray");
sb.setConfig("trayIcon", trigger_enabled);
sb.setConfig(SwitchboardConstants.TRAY_ICON_ENABLED, trigger_enabled);
redirect = true;
}
@ -303,7 +303,7 @@ public class Status
prop.put("otherPeers", "0"); // not online
}
if ( !sb.getConfigBool("browserPopUpTrigger", false) ) {
if ( !sb.getConfigBool(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, false) ) {
prop.put("popup", "0");
} else {
prop.put("popup", "1");
@ -311,7 +311,7 @@ public class Status
if ( !OS.isWindows ) {
prop.put("tray", "2");
} else if ( !sb.getConfigBool("trayIcon", false) ) {
} else if ( !sb.getConfigBool(SwitchboardConstants.TRAY_ICON_ENABLED, false) ) {
prop.put("tray", "0");
} else {
prop.put("tray", "1");

@ -120,27 +120,6 @@
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<finalName>yacy_v${project.version}_${DSTAMP}_${releaseNr}</finalName>
<outputDirectory>RELEASE</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- compile htroot -->
<plugin>
@ -184,6 +163,7 @@
<excludes>
htroot/*.java
</excludes>
<failOnError>false</failOnError>
</configuration>
</plugin>
@ -265,7 +245,7 @@
<execution>
<id>install-webcat-jar</id>
<phase>clean</phase>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
@ -281,7 +261,7 @@
<execution>
<id>install-J7Zip-jar</id>
<phase>clean</phase>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
@ -301,6 +281,35 @@
</build>
<profiles>
<profile>
<!-- profile to create a release archive -->
<id>release-profile</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<finalName>yacy_v${project.version}_${DSTAMP}_${releaseNr}</finalName>
<outputDirectory>RELEASE</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>report</id>
<build>

@ -71,6 +71,19 @@ public class swfParser extends AbstractParser implements Parser {
final SWF2HTML swf2html = new SWF2HTML();
String contents = "";
try {
// read and check file signature (library expect stream positioned after signature)
// magic bytes according to specification http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf-file-format-spec.pdf
// 0x46, 0x57, 0x53 (“FWS”) signature indicates an uncompressed SWF file
// 0x43, 0x57, 0x53 (“CWS”) indicates that the entire file after the first 8 bytes was compressed by using the ZLIB
// 0x5a, 0x57, 0x53 (“ZWS”) indicates that the entire file after the first 8 bytes was compressed by using the LZMA
int magic = source.read();
if (magic != 'F') // F=uncompressed, C= ZIP-compressed Z=LZMA-compressed
throw new Parser.Failure("compressed swf file not supported", location); // compressed not supported yet
magic = source.read(); // always 'W'
if (magic != 'W') throw new Parser.Failure("not a swf file (wrong file signature)", location);
magic = source.read(); // always 'S'
if (magic != 'S') throw new Parser.Failure("not a swf file (wrong file signature)", location);
contents = swf2html.convertSWFToHTML(source);
} catch (final NegativeArraySizeException e) {
throw new Parser.Failure(e.getMessage(), location);
@ -82,8 +95,6 @@ public class swfParser extends AbstractParser implements Parser {
String url = null;
String urlnr = null;
final String linebreak = System.getProperty("line.separator");
final List<String> abstrct = new ArrayList<String>();
//TreeSet images = null;
final List<AnchorURL> anchors = new ArrayList<AnchorURL>();
int urls = 0;
int urlStart = -1;
@ -120,17 +131,17 @@ public class swfParser extends AbstractParser implements Parser {
replaceAll("\n"," ").
replaceAll("\r"," ").
replaceAll("\t"," ")), // title
"", // TODO: AUTHOR
"",
null, // TODO: AUTHOR
null,
null, // an array of section headlines
abstrct, // an abstract
0.0f, 0.0f,
null, // an abstract
0.0d, 0.0d,
contents, // the parsed document text
anchors, // a map of extracted anchors
null,
null,
false,
new Date())}; // a treeset of image URLs
new Date())};
} catch (final Exception e) {
if (e instanceof InterruptedException) throw (InterruptedException) e;

Loading…
Cancel
Save