Skip to content

Commit

Permalink
Merge branch 'hotfix/3.0.1'
Browse files Browse the repository at this point in the history
fix directory creation failure after OS X 10.12.4 update
  • Loading branch information
alex1702 committed Mar 28, 2017
2 parents f728958 + 0caada7 commit 0356115
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ targetCompatibility = 1.8


group = 'de.mediathekview'
version = '3.0.0'
version = '3.0.1'

ext {
propsFile = file('src/main/resources/version.properties').absoluteFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
*/
package de.mediathekview.mlib.filmlisten;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.jidesoft.utils.SystemInfo;
import de.mediathekview.mlib.Const;
import de.mediathekview.mlib.daten.DatenFilm;
import de.mediathekview.mlib.daten.ListeFilme;
import de.mediathekview.mlib.tool.Log;
import org.tukaani.xz.LZMA2Options;
import org.tukaani.xz.XZOutputStream;

import java.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
Expand All @@ -33,18 +40,6 @@
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

import org.tukaani.xz.LZMA2Options;
import org.tukaani.xz.XZOutputStream;

import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;

import de.mediathekview.mlib.Const;
import de.mediathekview.mlib.daten.DatenFilm;
import de.mediathekview.mlib.daten.ListeFilme;
import de.mediathekview.mlib.tool.Log;

public class WriteFilmlistJson {

private void fastChannelCopy(final ReadableByteChannel src, final WritableByteChannel dest) throws IOException {
Expand Down Expand Up @@ -107,6 +102,14 @@ public void filmlisteSchreibenJson(String datei, ListeFilme listeFilme) {
Log.sysLog(" --> Start Schreiben nach: " + datei);
String sender = "", thema = "";

if (SystemInfo.isMacOSX()) {
//Hotfix for OSX 10.12.4 update
final Path f = Paths.get(datei);
final Path parentDirectory = f.getParent();
if (!Files.exists(parentDirectory))
Files.createDirectory(parentDirectory);
}

try (FileOutputStream fos = new FileOutputStream(datei);
JsonGenerator jg = getJsonGenerator(fos)) {

Expand Down

0 comments on commit 0356115

Please sign in to comment.