Fix issue with 415 error when starting with java instead of maven

This commit is contained in:
Jeff Lamb 2017-03-04 21:16:18 -05:00
parent 4ef91a13be
commit 534f0996b2
2 changed files with 3 additions and 1 deletions

View File

@ -75,6 +75,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.moparisthebest.rcrdit.requestbeans.GetScheduleRequest; import com.moparisthebest.rcrdit.requestbeans.GetScheduleRequest;
import com.moparisthebest.rcrdit.responsebeans.GetScheduleResponse; import com.moparisthebest.rcrdit.responsebeans.GetScheduleResponse;
import org.glassfish.jersey.jackson.JacksonFeature;
/** /**
* Created by mopar on 2/16/17. * Created by mopar on 2/16/17.
@ -103,6 +104,7 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
public RcrdIt(final File cfg) throws Exception { public RcrdIt(final File cfg) throws Exception {
register(this); register(this);
register(JacksonFeature.class);
final XmlElement rcrdit = AbstractXmlElement.getFactory().readFromFile(cfg); final XmlElement rcrdit = AbstractXmlElement.getFactory().readFromFile(cfg);
this.databaseUrl = rcrdit.getChild("databaseUrl").getValue(); this.databaseUrl = rcrdit.getChild("databaseUrl").getValue();

View File

@ -43,7 +43,7 @@ public class Channel {
this.displayNames = fromChannel.displayNames; this.displayNames = fromChannel.displayNames;
this.id = fromChannel.id; this.id = fromChannel.id;
List<Program> programsForNewChannel = new ArrayList<>(); List<Program> programsForNewChannel = new ArrayList<>();
fromChannel.getPrograms().stream().filter((program) -> ((program.getStop().isAfter(startTime) && program.getStop().isBefore(stopTime)) || (program.getStart().isBefore(stopTime) && program.getStart().isAfter(startTime) ) || program.getStart().equals(startTime) || program.getStop().equals(stopTime) )).forEach((program) -> { fromChannel.getPrograms().stream().filter((program) -> ((program.getStop().isAfter(startTime) && program.getStop().isBefore(stopTime)) || (program.getStart().isBefore(stopTime) && program.getStart().isAfter(startTime) )|| (program.getStart().isBefore(startTime) && program.getStop().isAfter(stopTime) ) || program.getStart().equals(startTime) || program.getStop().equals(stopTime) )).forEach((program) -> {
programsForNewChannel.add(program); programsForNewChannel.add(program);
}); });
this.programs.addAll(programsForNewChannel); this.programs.addAll(programsForNewChannel);