luc 9 years ago
commit 41767a01c2

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

@ -120,27 +120,6 @@
</filesets> </filesets>
</configuration> </configuration>
</plugin> </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 --> <!-- compile htroot -->
<plugin> <plugin>
@ -184,6 +163,7 @@
<excludes> <excludes>
htroot/*.java htroot/*.java
</excludes> </excludes>
<failOnError>false</failOnError>
</configuration> </configuration>
</plugin> </plugin>
@ -265,7 +245,7 @@
<execution> <execution>
<id>install-webcat-jar</id> <id>install-webcat-jar</id>
<phase>clean</phase> <phase>validate</phase>
<goals> <goals>
<goal>install-file</goal> <goal>install-file</goal>
</goals> </goals>
@ -281,7 +261,7 @@
<execution> <execution>
<id>install-J7Zip-jar</id> <id>install-J7Zip-jar</id>
<phase>clean</phase> <phase>validate</phase>
<goals> <goals>
<goal>install-file</goal> <goal>install-file</goal>
</goals> </goals>
@ -301,6 +281,35 @@
</build> </build>
<profiles> <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> <profile>
<id>report</id> <id>report</id>
<build> <build>

@ -71,6 +71,19 @@ public class swfParser extends AbstractParser implements Parser {
final SWF2HTML swf2html = new SWF2HTML(); final SWF2HTML swf2html = new SWF2HTML();
String contents = ""; String contents = "";
try { 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); contents = swf2html.convertSWFToHTML(source);
} catch (final NegativeArraySizeException e) { } catch (final NegativeArraySizeException e) {
throw new Parser.Failure(e.getMessage(), location); throw new Parser.Failure(e.getMessage(), location);
@ -82,8 +95,6 @@ public class swfParser extends AbstractParser implements Parser {
String url = null; String url = null;
String urlnr = null; String urlnr = null;
final String linebreak = System.getProperty("line.separator"); final String linebreak = System.getProperty("line.separator");
final List<String> abstrct = new ArrayList<String>();
//TreeSet images = null;
final List<AnchorURL> anchors = new ArrayList<AnchorURL>(); final List<AnchorURL> anchors = new ArrayList<AnchorURL>();
int urls = 0; int urls = 0;
int urlStart = -1; int urlStart = -1;
@ -120,17 +131,17 @@ public class swfParser extends AbstractParser implements Parser {
replaceAll("\n"," "). replaceAll("\n"," ").
replaceAll("\r"," "). replaceAll("\r"," ").
replaceAll("\t"," ")), // title replaceAll("\t"," ")), // title
"", // TODO: AUTHOR null, // TODO: AUTHOR
"", null,
null, // an array of section headlines null, // an array of section headlines
abstrct, // an abstract null, // an abstract
0.0f, 0.0f, 0.0d, 0.0d,
contents, // the parsed document text contents, // the parsed document text
anchors, // a map of extracted anchors anchors, // a map of extracted anchors
null, null,
null, null,
false, false,
new Date())}; // a treeset of image URLs new Date())};
} catch (final Exception e) { } catch (final Exception e) {
if (e instanceof InterruptedException) throw (InterruptedException) e; if (e instanceof InterruptedException) throw (InterruptedException) e;

Loading…
Cancel
Save