package net.pterodactylus.jsite.project;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import net.pterodactylus.util.logging.Logging;
+
/**
* An override is used to enter other information about a file than the defaults
* would have yielded. It is also used to add redirects to a project.
*/
public class FileOverride {
+ /** The logger. */
+ private static final Logger logger = Logging.getLogger(FileOverride.class.getName());
+
/** The insert override. */
private Boolean insert;
public static FileOverride valueOf(String overrideString) {
FileOverride override = new FileOverride();
String[] parts = overrideString.split("\\|");
- if (parts.length < 3) {
- return null;
- }
- if (parts[0].length() > 0) {
+ logger.log(Level.FINEST, "parts.length: " + parts.length);
+ if ((parts.length > 0) && (parts[0].length() > 0)) {
override.insert = Boolean.valueOf(parts[0]);
}
- if (parts[1].length() > 0) {
+ if ((parts.length > 1) && (parts[1].length() > 0)) {
override.contentType = parts[1];
}
- if (parts[2].length() > 0) {
+ if ((parts.length > 2) && (parts[2].length() > 0)) {
override.redirectTarget = parts[2];
}
return override;