Example usage for java.lang System lineSeparator

List of usage examples for java.lang System lineSeparator

Introduction

In this page you can find the example usage for java.lang System lineSeparator.

Prototype

String lineSeparator

To view the source code for java.lang System lineSeparator.

Click Source Link

Usage

From source file:org.osgp.adapter.protocol.dlms.domain.commands.DlmsHelperService.java

private void appendItemValues(final DataObject dataObject, final StringBuilder builder) {
    for (final Object obj : (List<?>) dataObject.value()) {
        builder.append("\t");
        if (obj instanceof DataObject) {
            builder.append(this.getDebugInfo((DataObject) obj));
        } else {/*from w w  w .  ja  va 2  s.c  om*/
            builder.append(String.valueOf(obj));
        }
        builder.append(System.lineSeparator());
    }
}

From source file:org.apache.nifi.processors.standard.util.TestInvokeHttpCommon.java

@Test
public void test401NotAuth() throws Exception {
    addHandler(new BasicAuthHandler());

    final String username = "basic_user";
    final String password = "basic_password";

    runner.setProperty(InvokeHTTP.PROP_URL, url + "/status/401");
    runner.setProperty(InvokeHTTP.PROP_BASIC_AUTH_USERNAME, username);
    runner.setProperty(InvokeHTTP.PROP_BASIC_AUTH_PASSWORD, password);

    createFlowFiles(runner);/*www.ja v  a 2 s . co  m*/

    runner.run();

    runner.assertTransferCount(InvokeHTTP.REL_SUCCESS_REQ, 0);
    runner.assertTransferCount(InvokeHTTP.REL_RESPONSE, 0);
    runner.assertTransferCount(InvokeHTTP.REL_RETRY, 0);
    runner.assertTransferCount(InvokeHTTP.REL_NO_RETRY, 1);
    runner.assertTransferCount(InvokeHTTP.REL_FAILURE, 0);
    runner.assertPenalizeCount(0);

    // expected in request status.code and status.message
    // original flow file (+attributes)
    final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.REL_NO_RETRY).get(0);
    bundle.assertAttributeEquals(InvokeHTTP.STATUS_CODE, "401");
    bundle.assertAttributeEquals(InvokeHTTP.STATUS_MESSAGE, "Unauthorized");
    bundle.assertAttributeEquals("Foo", "Bar");
    final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
    final String expected = "Hello";
    Assert.assertEquals(expected, actual);

    final String response = bundle.getAttribute(InvokeHTTP.RESPONSE_BODY);
    assertEquals(response, "Get off my lawn!" + System.lineSeparator());
}

From source file:io.hops.hopsworks.api.pythonDeps.PythonDepsService.java

private String getYmlFromPath(String path, String username)
        throws DatasetException, ProjectException, ServiceException {

    DsPath ymlPath = pathValidator.validatePath(this.project, path);
    ymlPath.validatePathExists(inodes, false);
    org.apache.hadoop.fs.Path fullPath = ymlPath.getFullPath();
    DistributedFileSystemOps udfso = null;
    try {//from  w ww. j a  v  a 2 s  .  co m
        udfso = dfs.getDfsOps(username);
        //tests if the user have permission to access this path

        long fileSize = udfso.getFileStatus(fullPath).getLen();
        byte[] ymlFileInBytes = new byte[(int) fileSize];

        if (fileSize < 10000) {
            try (DataInputStream dis = new DataInputStream(udfso.open(fullPath))) {
                dis.readFully(ymlFileInBytes, 0, (int) fileSize);
                String ymlFileContents = new String(ymlFileInBytes);

                ymlFileContents = Arrays.stream(ymlFileContents.split(System.lineSeparator()))
                        .filter(line -> !line.contains("mmlspark=="))
                        .collect(Collectors.joining(System.lineSeparator()));

                return ymlFileContents;
            }
        } else {
            throw new ServiceException(RESTCodes.ServiceErrorCode.INVALID_YML_SIZE, Level.WARNING);
        }

    } catch (IOException ex) {
        throw new ServiceException(RESTCodes.ServiceErrorCode.ANACONDA_FROM_YML_ERROR, Level.SEVERE,
                "path: " + path, ex.getMessage(), ex);
    } finally {
        if (udfso != null) {
            dfs.closeDfsClient(udfso);
        }
    }
}

From source file:net.certifi.audittablegen.GenericDMR.java

String getCreateTriggerSQL(List<DBChangeUnit> op) {

    StringBuilder builder = new StringBuilder();
    StringBuilder insertDetail = new StringBuilder();
    StringBuilder deleteDetail = new StringBuilder();
    StringBuilder updateDetail = new StringBuilder();
    StringBuilder updateConditional = new StringBuilder();
    String functionName = null;//from w ww.j av  a  2 s .  c  om
    String triggerName = null;
    String triggerReference = null;
    String tableName = null;
    String auditTableName = null;
    String actionColumn = null;
    String userColumn = null;
    String sessionUserColumn = null;
    String timeStampColumn = null;
    boolean firstTrig = true;
    boolean onDelete = true;
    boolean onInsert = true;
    boolean onUpdate = true;
    List<String> columns = new ArrayList<>();
    List<String> whenColumns = new ArrayList<>();
    String schema;

    if (verifiedSchema != null) {
        schema = verifiedSchema + ".";
    } else {
        schema = "";
    }

    for (DBChangeUnit unit : op) {
        switch (unit.changeType) {
        case begin:
            //nothinig
            break;
        case end:
            if (actionColumn == null || timeStampColumn == null || userColumn == null) {
                logger.error("Trigger info for table %s missing audit columns for: %s %s %s", tableName,
                        actionColumn == null ? "action " : "", timeStampColumn == null ? "timeStamp " : "",
                        userColumn == null ? "user" : "");
                return null;
            }

            //////////////////////
            //generate the when clause for the update trigger
            if (columns.size() > whenColumns.size()) {
                //some columns excluded from update
                updateConditional.append("AND (");
                boolean firstCol = true;
                for (String col : whenColumns) {
                    if (!firstCol) {
                        updateConditional.append("            OR ");

                    }
                    firstCol = false;
                    updateConditional.append("OLD.").append(col).append(" IS DISTINCT FROM NEW.").append(col)
                            .append(System.lineSeparator());
                }
                updateConditional.append("            )) THEN").append(System.lineSeparator());
            } else {
                //no column conditions.  Alwasy insert audit row on update
                updateConditional.append(") THEN").append(System.lineSeparator());
            }

            //////////////////////                     
            //generate the detail insert column list for the trigger(s)
            insertDetail.append(String.format("        INSERT INTO %s%s (%s, %s, %s", schema, auditTableName,
                    actionColumn, userColumn, timeStampColumn));
            updateDetail.append(String.format("        INSERT INTO %s%s (%s, %s, %s", schema, auditTableName,
                    actionColumn, userColumn, timeStampColumn));
            deleteDetail.append(String.format("        INSERT INTO %s%s (%s, %s, %s", schema, auditTableName,
                    actionColumn, userColumn, timeStampColumn));

            if (sessionUserColumn != null) {
                insertDetail.append(", ").append(sessionUserColumn);
                updateDetail.append(", ").append(sessionUserColumn);
                deleteDetail.append(", ").append(sessionUserColumn);
            }
            for (String col : columns) {
                insertDetail.append(", ").append(col);
                updateDetail.append(", ").append(col);
                deleteDetail.append(", ").append(col);
            }
            insertDetail.append(")").append(System.lineSeparator());
            updateDetail.append(")").append(System.lineSeparator());
            deleteDetail.append(")").append(System.lineSeparator());

            //////////////////////
            //generate the insert column valuues for the trigger(s)
            insertDetail.append("        SELECT 'insert', user, now()");
            updateDetail.append("        SELECT 'update', user, now()");
            deleteDetail.append("        SELECT 'delete', user, now()");
            if (sessionUserColumn != null) {
                insertDetail.append(", ").append(this.getSessionUserSQL());
                updateDetail.append(", ").append(this.getSessionUserSQL());
                deleteDetail.append(", ").append(this.getSessionUserSQL());
            }
            for (String col : columns) {
                insertDetail.append(", NEW.").append(col);
                updateDetail.append(", NEW.").append(col);
                deleteDetail.append(", OLD.").append(col);
            }
            insertDetail.append(";").append(System.lineSeparator());
            updateDetail.append(";").append(System.lineSeparator());
            deleteDetail.append(";").append(System.lineSeparator());
            insertDetail.append("        RETURN NEW;").append(System.lineSeparator());
            updateDetail.append("        RETURN NEW;").append(System.lineSeparator());
            deleteDetail.append("        RETURN OLD;").append(System.lineSeparator());

            //////////////////////
            //creat the function that the trigger calls
            builder.append("CREATE OR REPLACE FUNCTION ").append(schema).append(functionName)
                    .append(" RETURNS TRIGGER AS ").append(triggerReference).append(System.lineSeparator());
            builder.append("BEGIN").append(System.lineSeparator());
            builder.append("    IF (TG_OP = 'DELETE') THEN").append(System.lineSeparator());
            builder.append(deleteDetail);
            builder.append("    ELSEIF (TG_OP = 'INSERT') THEN").append(System.lineSeparator());
            builder.append(insertDetail);
            builder.append("    ELSEIF (TG_OP = 'UPDATE' ").append(updateConditional)
                    .append(System.lineSeparator());
            builder.append(updateDetail);
            builder.append("    END IF;").append(System.lineSeparator());
            builder.append("END").append(System.lineSeparator());
            builder.append(triggerReference).append(" LANGUAGE plpgsql;").append(System.lineSeparator());

            ///////////////////////                    
            //create the trigger
            builder.append("DROP TRIGGER IF EXISTS ").append(triggerName).append(" ON ").append(schema)
                    .append(tableName).append(";").append(System.lineSeparator());
            builder.append("CREATE TRIGGER ").append(triggerName).append(System.lineSeparator());
            builder.append("AFTER ");
            if (onInsert) {
                builder.append("INSERT ");
                firstTrig = false;
            }
            if (onUpdate) {
                if (!firstTrig) {
                    builder.append("OR UPDATE ");
                } else {
                    builder.append("UPDATE ");
                    firstTrig = false;
                }
            }
            if (onDelete) {
                if (!firstTrig) {
                    builder.append("OR DELETE ");
                } else {
                    builder.append("DELETE ");
                }
            }
            builder.append("ON ").append(schema).append(tableName).append(System.lineSeparator());
            builder.append("FOR EACH ROW EXECUTE PROCEDURE ").append(schema).append(functionName).append(";")
                    .append(System.lineSeparator());
            //run the sql...
            break;
        case createTriggers:
            tableName = unit.getTableName();
            triggerName = unit.getTableName() + "_audit";
            functionName = "process_" + triggerName + "()";
            triggerReference = "$" + triggerName + "$";
            auditTableName = unit.getAuditTableName();
            break;
        case fireOnDelete:
            onDelete = unit.getFiresTrigger();
            break;
        case fireOnInsert:
            onInsert = unit.getFiresTrigger();
            break;
        case fireOnUpdate:
            onUpdate = unit.getFiresTrigger();
            break;
        case addTriggerColumn:
            if (unit.firesTrigger) {
                whenColumns.add(unit.getColumnName());
            }
            columns.add(unit.columnName);
            break;
        case addTriggerAction:
            actionColumn = unit.getColumnName();
            break;
        case addTriggerUser:
            userColumn = unit.getColumnName();
            break;
        case addTriggerTimeStamp:
            timeStampColumn = unit.getColumnName();
            break;
        case addTriggerSessionUser:
            sessionUserColumn = unit.getColumnName();
            break;
        default:
            //should not get here if the list is valid, unless a new changetype
            //was added that this DMR does not know about.  If which case - fail.
            logger.error("unimplemented DBChangeUnit {} for create trigger operation",
                    unit.getChangeType().toString());
            return null;
        }
    }

    return builder.toString();

}

From source file:de.ist.clonto.Ontogui.java

private void runSmellAnalysisButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_runSmellAnalysisButtonActionPerformed
    String filename = smellName;// w  w w . j a v  a 2 s  .  c  o  m
    File smellFile = new File(
            System.getProperty("user.dir") + "/sparql/smells/" + filename.replaceAll(" ", "") + ".sparql");

    List<String> lines = null;

    try {
        lines = Files.readAllLines(smellFile.toPath());
    } catch (IOException ex) {
        Logger.getLogger(Ontogui.class.getName()).log(Level.SEVERE, null, ex);
    }
    String queryString = "";
    for (String line : lines) {
        queryString += line + System.lineSeparator();
    }
    Query query = QueryFactory.create(queryString, Syntax.syntaxARQ);
    queryResultArea.setText("Starting analysis: " + smellName + "\n");
    Thread t = new Thread(
            new QueryProcessor(query, new QueryAreaStream(queryResultArea), dataset, checkbox1.getState()));
    t.start();
}

From source file:ddf.catalog.impl.CatalogFrameworkImpl.java

private Metacard generateMetacard(String mimeTypeRaw, String id, String fileName, long size, Subject subject,
        Path tmpContentPath) throws MetacardCreationException, MimeTypeParseException {

    Metacard generatedMetacard = null;//w  w w. j av  a 2  s  . c  o m
    InputTransformer transformer = null;
    StringBuilder causeMessage = new StringBuilder("Could not create metacard with mimeType ");
    try {
        MimeType mimeType = new MimeType(mimeTypeRaw);

        List<InputTransformer> listOfCandidates = frameworkProperties.getMimeTypeToTransformerMapper()
                .findMatches(InputTransformer.class, mimeType);

        LOGGER.debug("List of matches for mimeType [{}]: {}", mimeType, listOfCandidates);

        for (InputTransformer candidate : listOfCandidates) {
            transformer = candidate;

            try (InputStream transformerStream = com.google.common.io.Files
                    .asByteSource(tmpContentPath.toFile()).openStream()) {
                generatedMetacard = transformer.transform(transformerStream);
            }
            if (generatedMetacard != null) {
                break;
            }
        }
    } catch (CatalogTransformerException | IOException e) {
        causeMessage.append(mimeTypeRaw).append(". Reason: ").append(System.lineSeparator())
                .append(e.getMessage());

        // The caught exception more than likely does not have the root cause message
        // that is needed to inform the caller as to why things have failed.  Therefore
        // we need to iterate through the chain of cause exceptions and gather up
        // all of their message details.
        Throwable cause = e.getCause();
        while (cause != null && cause != cause.getCause()) {
            causeMessage.append(System.lineSeparator()).append(cause.getMessage());
            cause = cause.getCause();
        }
        LOGGER.debug("Transformer [{}] could not create metacard.", transformer, e);
    }

    if (generatedMetacard == null) {
        throw new MetacardCreationException(causeMessage.toString());
    }

    if (id != null) {
        generatedMetacard.setAttribute(new AttributeImpl(Metacard.ID, id));
    } else {
        generatedMetacard
                .setAttribute(new AttributeImpl(Metacard.ID, UUID.randomUUID().toString().replaceAll("-", "")));
    }

    if (StringUtils.isBlank(generatedMetacard.getTitle())) {
        generatedMetacard.setAttribute(new AttributeImpl(Metacard.TITLE, fileName));
    }

    String name = SubjectUtils.getName(subject);

    generatedMetacard.setAttribute(new AttributeImpl(Metacard.POINT_OF_CONTACT, name == null ? "" : name));

    return generatedMetacard;

}

From source file:org.apache.nifi.processors.standard.util.TestInvokeHttpCommon.java

@Test
public void test200DigestAuth() throws Exception {
    addHandler(new DigestAuthHandler());
    final String username = "basic_user";
    final String password = "basic_password";

    runner.setProperty(InvokeHTTP.PROP_URL, url + "/status/200");
    runner.setProperty(InvokeHTTP.PROP_BASIC_AUTH_USERNAME, username);
    runner.setProperty(InvokeHTTP.PROP_BASIC_AUTH_PASSWORD, password);
    runner.setProperty(InvokeHTTP.PROP_DIGEST_AUTH, "true");

    createFlowFiles(runner);/*w  ww .  j a  v  a2 s  .c o  m*/

    runner.run();

    runner.assertTransferCount(InvokeHTTP.REL_SUCCESS_REQ, 1);
    runner.assertTransferCount(InvokeHTTP.REL_RESPONSE, 1);
    runner.assertTransferCount(InvokeHTTP.REL_RETRY, 0);
    runner.assertTransferCount(InvokeHTTP.REL_NO_RETRY, 0);
    runner.assertTransferCount(InvokeHTTP.REL_FAILURE, 0);
    runner.assertPenalizeCount(0);

    //expected in request status.code and status.message
    //original flow file (+attributes)
    final MockFlowFile bundle = runner.getFlowFilesForRelationship(InvokeHTTP.REL_SUCCESS_REQ).get(0);
    bundle.assertAttributeEquals(InvokeHTTP.STATUS_CODE, "200");
    bundle.assertAttributeEquals(InvokeHTTP.STATUS_MESSAGE, "OK");
    bundle.assertAttributeEquals("Foo", "Bar");
    final String actual = new String(bundle.toByteArray(), StandardCharsets.UTF_8);
    final String expected = "Hello";
    Assert.assertEquals(expected, actual);

    //expected in response
    //status code, status message, all headers from server response --> ff attributes
    //server response message body into payload of ff
    final MockFlowFile bundle1 = runner.getFlowFilesForRelationship(InvokeHTTP.REL_RESPONSE).get(0);
    bundle1.assertContentEquals(("DIGEST" + System.lineSeparator()).getBytes("UTF-8"));
    bundle1.assertAttributeEquals(InvokeHTTP.STATUS_CODE, "200");
    bundle1.assertAttributeEquals(InvokeHTTP.STATUS_MESSAGE, "OK");
    bundle1.assertAttributeEquals("Foo", "Bar");
    bundle1.assertAttributeEquals("Content-Type", "text/plain;charset=iso-8859-1");
}

From source file:dpfmanager.conformancechecker.tiff.reporting.HtmlReport.java

/**
 * Read filefrom resources string.//from w w w  .j av  a  2  s. c  o  m
 *
 * @param pathStr the path str
 * @return the string
 */
public String readFilefromResources(String pathStr) {
    String text = "";
    Path path = Paths.get(pathStr);
    try {
        if (Files.exists(path)) {
            // Look in current dir
            BufferedReader br = new BufferedReader(new FileReader(pathStr));
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) {
                sb.append(line);
                sb.append(System.lineSeparator());
                line = br.readLine();
            }
            text = sb.toString();
            br.close();
        } else {
            // Look in JAR
            Class cls = ReportGenerator.class;
            ClassLoader cLoader = cls.getClassLoader();
            InputStream in = cLoader.getResourceAsStream(pathStr);
            if (in != null) {
                BufferedReader reader = new BufferedReader(new InputStreamReader(in));
                StringBuilder out = new StringBuilder();
                String newLine = System.getProperty("line.separator");
                String line;
                while ((line = reader.readLine()) != null) {
                    out.append(line);
                    out.append(newLine);
                }
                text = out.toString();
            }
        }
    } catch (FileNotFoundException e) {

    } catch (IOException e) {

    }

    return text;
}

From source file:com.floragunn.searchguard.tools.SearchGuardAdmin.java

protected static void generateDiagnoseTrace(final Client tc) {

    final String date = DATE_FORMAT.format(new Date());

    final StringBuilder sb = new StringBuilder();
    sb.append("Diagnostic sgadmin trace" + System.lineSeparator());
    sb.append("ES client version: " + Version.CURRENT + System.lineSeparator());
    sb.append("Client properties: " + System.getProperties() + System.lineSeparator());
    sb.append(date + System.lineSeparator());
    sb.append(System.lineSeparator());

    try {//from   ww w.  j a  v a 2s  .c om
        sb.append("ClusterHealthRequest:" + System.lineSeparator());
        ClusterHealthResponse nir = tc.admin().cluster().health(new ClusterHealthRequest()).actionGet();
        sb.append(XContentHelper.toString(nir));
    } catch (Exception e1) {
        sb.append(ExceptionsHelper.stackTrace(e1));
    }

    try {
        sb.append(System.lineSeparator() + "NodesInfoResponse:" + System.lineSeparator());
        NodesInfoResponse nir = tc.admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet();
        sb.append(XContentHelper.toString(nir));
    } catch (Exception e1) {
        sb.append(ExceptionsHelper.stackTrace(e1));
    }

    try {
        sb.append(System.lineSeparator() + "NodesStatsRequest:" + System.lineSeparator());
        NodesStatsResponse nir = tc.admin().cluster().nodesStats(new NodesStatsRequest()).actionGet();
        sb.append(XContentHelper.toString(nir));
    } catch (Exception e1) {
        sb.append(ExceptionsHelper.stackTrace(e1));
    }

    try {
        sb.append(System.lineSeparator() + "PendingClusterTasksRequest:" + System.lineSeparator());
        PendingClusterTasksResponse nir = tc.admin().cluster()
                .pendingClusterTasks(new PendingClusterTasksRequest()).actionGet();
        sb.append(XContentHelper.toString(nir));
    } catch (Exception e1) {
        sb.append(ExceptionsHelper.stackTrace(e1));
    }

    try {
        sb.append(System.lineSeparator() + "ClusterStateRequest:" + System.lineSeparator());
        ClusterStateResponse nir = tc.admin().cluster().state(new ClusterStateRequest()).actionGet();
        sb.append(XContentHelper.toString(nir.getState()));
    } catch (Exception e1) {
        sb.append(ExceptionsHelper.stackTrace(e1));
    }

    try {
        sb.append(System.lineSeparator() + "IndicesStatsRequest:" + System.lineSeparator());
        IndicesStatsResponse nir = tc.admin().indices().stats(new IndicesStatsRequest()).actionGet();
        sb.append(XContentHelper.toString(nir));
    } catch (Exception e1) {
        sb.append(ExceptionsHelper.stackTrace(e1));
    }

    try {
        File dfile = new File("sgadmin_diag_trace_" + date + ".txt");
        Files.write(sb, dfile, Charset.forName("UTF-8"));
        System.out.println("Diagnostic trace written to: " + dfile.getAbsolutePath());
    } catch (Exception e1) {
        System.out.println("ERR: cannot write diag trace file due to " + e1);
    }
}

From source file:net.sf.jabref.JabRefPreferences.java

private JabRefPreferences() {
    try {//ww w  . j  a va2 s  .c  o  m
        if (new File("jabref.xml").exists()) {
            importPreferences("jabref.xml");
        }
    } catch (JabRefException e) {
        LOGGER.warn("Could not import preferences from jabref.xml: " + e.getMessage(), e);
    }

    // load user preferences
    prefs = Preferences.userNodeForPackage(JabRefMain.class);

    defaults.put(TEXMAKER_PATH, JabRefDesktop.getNativeDesktop().detectProgramPath("texmaker", "Texmaker"));
    defaults.put(WIN_EDT_PATH,
            JabRefDesktop.getNativeDesktop().detectProgramPath("WinEdt", "WinEdt Team\\WinEdt"));
    defaults.put(LATEX_EDITOR_PATH, JabRefDesktop.getNativeDesktop().detectProgramPath("LEd", "LEd"));
    defaults.put(TEXSTUDIO_PATH, JabRefDesktop.getNativeDesktop().detectProgramPath("texstudio", "TeXstudio"));

    defaults.put(BIBLATEX_DEFAULT_MODE, false);

    if (OS.OS_X) {
        defaults.put(EMACS_PATH, "emacsclient");
        defaults.put(EMACS_23, true);
        defaults.put(EMACS_ADDITIONAL_PARAMETERS, "-n -e");
        defaults.put(FONT_FAMILY, "SansSerif");
        defaults.put(WIN_LOOK_AND_FEEL, UIManager.getSystemLookAndFeelClassName());

    } else if (OS.WINDOWS) {
        defaults.put(WIN_LOOK_AND_FEEL, "com.jgoodies.looks.windows.WindowsLookAndFeel");
        defaults.put(EMACS_PATH, "emacsclient.exe");
        defaults.put(EMACS_23, true);
        defaults.put(EMACS_ADDITIONAL_PARAMETERS, "-n -e");
        defaults.put(FONT_FAMILY, "Arial");

    } else {
        // Linux
        defaults.put(WIN_LOOK_AND_FEEL, "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel");
        defaults.put(FONT_FAMILY, "SansSerif");

        defaults.put(EMACS_PATH, "gnuclient");
        defaults.put(EMACS_23, false);
        defaults.put(EMACS_ADDITIONAL_PARAMETERS, "-batch -eval");
    }
    defaults.put(PUSH_TO_APPLICATION, "TeXstudio");

    defaults.put(RECENT_FILES, "");
    defaults.put(EXTERNAL_FILE_TYPES, "");
    defaults.put(KEY_PATTERN_REGEX, "");
    defaults.put(KEY_PATTERN_REPLACEMENT, "");

    // Proxy
    defaults.put(PROXY_USE, Boolean.FALSE);
    defaults.put(PROXY_HOSTNAME, "");
    defaults.put(PROXY_PORT, "80");
    defaults.put(PROXY_USE_AUTHENTICATION, Boolean.FALSE);
    defaults.put(PROXY_USERNAME, "");
    defaults.put(PROXY_PASSWORD, "");

    defaults.put(USE_DEFAULT_LOOK_AND_FEEL, Boolean.TRUE);
    defaults.put(LYXPIPE, USER_HOME + File.separator + ".lyx/lyxpipe");
    defaults.put(VIM, "vim");
    defaults.put(VIM_SERVER, "vim");
    defaults.put(POS_X, 0);
    defaults.put(POS_Y, 0);
    defaults.put(SIZE_X, 1024);
    defaults.put(SIZE_Y, 768);
    defaults.put(WINDOW_MAXIMISED, Boolean.FALSE);
    defaults.put(AUTO_RESIZE_MODE, JTable.AUTO_RESIZE_ALL_COLUMNS);
    defaults.put(PREVIEW_PANEL_HEIGHT, 200);
    defaults.put(ENTRY_EDITOR_HEIGHT, 400);
    defaults.put(TABLE_COLOR_CODES_ON, Boolean.FALSE);
    defaults.put(NAMES_AS_IS, Boolean.FALSE); // "Show names unchanged"
    defaults.put(NAMES_FIRST_LAST, Boolean.FALSE); // "Show 'Firstname Lastname'"
    defaults.put(NAMES_NATBIB, Boolean.TRUE); // "Natbib style"
    defaults.put(ABBR_AUTHOR_NAMES, Boolean.TRUE); // "Abbreviate names"
    defaults.put(NAMES_LAST_ONLY, Boolean.TRUE); // "Show last names only"
    // system locale as default
    defaults.put(LANGUAGE, Locale.getDefault().getLanguage());

    // Sorting preferences
    defaults.put(TABLE_PRIMARY_SORT_FIELD, "author");
    defaults.put(TABLE_PRIMARY_SORT_DESCENDING, Boolean.FALSE);
    defaults.put(TABLE_SECONDARY_SORT_FIELD, "year");
    defaults.put(TABLE_SECONDARY_SORT_DESCENDING, Boolean.TRUE);
    defaults.put(TABLE_TERTIARY_SORT_FIELD, "title");
    defaults.put(TABLE_TERTIARY_SORT_DESCENDING, Boolean.FALSE);

    defaults.put(REFORMAT_FILE_ON_SAVE_AND_EXPORT, Boolean.FALSE);

    // export order
    defaults.put(EXPORT_IN_ORIGINAL_ORDER, Boolean.FALSE);
    defaults.put(EXPORT_IN_SPECIFIED_ORDER, Boolean.FALSE);

    // export order: if EXPORT_IN_SPECIFIED_ORDER, then use following criteria
    defaults.put(EXPORT_PRIMARY_SORT_FIELD, "bibtexkey");
    defaults.put(EXPORT_PRIMARY_SORT_DESCENDING, Boolean.FALSE);
    defaults.put(EXPORT_SECONDARY_SORT_FIELD, "author");
    defaults.put(EXPORT_SECONDARY_SORT_DESCENDING, Boolean.FALSE);
    defaults.put(EXPORT_TERTIARY_SORT_FIELD, "title");
    defaults.put(EXPORT_TERTIARY_SORT_DESCENDING, Boolean.TRUE);

    defaults.put(NEWLINE, System.lineSeparator());

    defaults.put(SIDE_PANE_COMPONENT_NAMES, "");
    defaults.put(SIDE_PANE_COMPONENT_PREFERRED_POSITIONS, "");

    defaults.put(COLUMN_NAMES, "entrytype;author/editor;title;year;journal/booktitle;bibtexkey");
    defaults.put(COLUMN_WIDTHS, "75;300;470;60;130;100");
    defaults.put(PersistenceTableColumnListener.ACTIVATE_PREF_KEY,
            PersistenceTableColumnListener.DEFAULT_ENABLED);
    defaults.put(XMP_PRIVACY_FILTERS, "pdf;timestamp;keywords;owner;note;review");
    defaults.put(USE_XMP_PRIVACY_FILTER, Boolean.FALSE);
    defaults.put(NUMBER_COL_WIDTH, GUIGlobals.NUMBER_COL_LENGTH);
    defaults.put(WORKING_DIRECTORY, USER_HOME);
    defaults.put(EXPORT_WORKING_DIRECTORY, USER_HOME);
    // Remembers working directory of last import
    defaults.put(IMPORT_WORKING_DIRECTORY, USER_HOME);
    defaults.put(FILE_WORKING_DIRECTORY, USER_HOME);
    defaults.put(AUTO_OPEN_FORM, Boolean.TRUE);
    defaults.put(BACKUP, Boolean.TRUE);
    defaults.put(OPEN_LAST_EDITED, Boolean.TRUE);
    defaults.put(LAST_EDITED, "");
    defaults.put(LAST_FOCUSED, "");
    defaults.put(STRINGS_POS_X, 0);
    defaults.put(STRINGS_POS_Y, 0);
    defaults.put(STRINGS_SIZE_X, 600);
    defaults.put(STRINGS_SIZE_Y, 400);
    defaults.put(DUPLICATES_POS_X, 0);
    defaults.put(DUPLICATES_POS_Y, 0);
    defaults.put(DUPLICATES_SIZE_X, 800);
    defaults.put(DUPLICATES_SIZE_Y, 600);
    defaults.put(MERGEENTRIES_POS_X, 0);
    defaults.put(MERGEENTRIES_POS_Y, 0);
    defaults.put(MERGEENTRIES_SIZE_X, 800);
    defaults.put(MERGEENTRIES_SIZE_Y, 600);
    defaults.put(PREAMBLE_POS_X, 0);
    defaults.put(PREAMBLE_POS_Y, 0);
    defaults.put(PREAMBLE_SIZE_X, 600);
    defaults.put(PREAMBLE_SIZE_Y, 400);
    defaults.put(DEFAULT_SHOW_SOURCE, Boolean.FALSE);
    defaults.put(DEFAULT_AUTO_SORT, Boolean.FALSE);
    defaults.put(SEARCH_CASE_SENSITIVE, Boolean.FALSE);
    defaults.put(SEARCH_MODE_FILTER, Boolean.TRUE);

    defaults.put(SEARCH_REG_EXP, Boolean.FALSE);
    defaults.put(SEARCH_PANE_POS_X, 0);
    defaults.put(SEARCH_PANE_POS_Y, 0);

    defaults.put(MERGE_ENTRIES_DIFF_MODE, 2);

    defaults.put(EDITOR_EMACS_KEYBINDINGS, Boolean.FALSE);
    defaults.put(EDITOR_EMACS_KEYBINDINGS_REBIND_CA, Boolean.TRUE);
    defaults.put(EDITOR_EMACS_KEYBINDINGS_REBIND_CF, Boolean.TRUE);
    defaults.put(AUTO_COMPLETE, Boolean.TRUE);
    AutoCompletePreferences.putDefaults(defaults);
    defaults.put(GROUP_FLOAT_SELECTIONS, Boolean.TRUE);
    defaults.put(GROUP_INTERSECT_SELECTIONS, Boolean.TRUE);
    defaults.put(GROUP_INVERT_SELECTIONS, Boolean.FALSE);
    defaults.put(GROUP_SHOW_OVERLAPPING, Boolean.FALSE);
    defaults.put(GROUP_SELECT_MATCHES, Boolean.FALSE);
    defaults.put(GROUPS_DEFAULT_FIELD, "keywords");
    defaults.put(GROUP_SHOW_ICONS, Boolean.TRUE);
    defaults.put(GROUP_SHOW_DYNAMIC, Boolean.TRUE);
    defaults.put(GROUP_EXPAND_TREE, Boolean.TRUE);
    defaults.put(GROUP_AUTO_SHOW, Boolean.TRUE);
    defaults.put(GROUP_AUTO_HIDE, Boolean.TRUE);
    defaults.put(GROUP_SHOW_NUMBER_OF_ELEMENTS, Boolean.FALSE);
    defaults.put(AUTO_ASSIGN_GROUP, Boolean.TRUE);
    defaults.put(GROUP_KEYWORD_SEPARATOR, ", ");
    defaults.put(EDIT_GROUP_MEMBERSHIP_MODE, Boolean.FALSE);
    defaults.put(HIGHLIGHT_GROUPS_MATCHING, "");
    defaults.put(TOOLBAR_VISIBLE, Boolean.TRUE);
    defaults.put(DEFAULT_ENCODING, StandardCharsets.UTF_8.name());
    defaults.put(GROUPS_VISIBLE_ROWS, 8);
    defaults.put(DEFAULT_OWNER, System.getProperty("user.name"));
    defaults.put(MEMORY_STICK_MODE, Boolean.FALSE);
    defaults.put(RENAME_ON_MOVE_FILE_TO_FILE_DIR, Boolean.TRUE);

    // The general fields stuff is made obsolete by the CUSTOM_TAB_... entries.
    defaults.put(GENERAL_FIELDS, "crossref;keywords;file;doi;url;urldate;" + "pdf;comment;owner");

    defaults.put(FONT_STYLE, java.awt.Font.PLAIN);
    defaults.put(FONT_SIZE, 12);
    defaults.put(OVERRIDE_DEFAULT_FONTS, Boolean.FALSE);
    defaults.put(MENU_FONT_SIZE, 11);
    defaults.put(TABLE_ROW_PADDING, GUIGlobals.TABLE_ROW_PADDING);
    defaults.put(TABLE_SHOW_GRID, Boolean.FALSE);
    // Main table color settings:
    defaults.put(TABLE_BACKGROUND, "255:255:255");
    defaults.put(TABLE_REQ_FIELD_BACKGROUND, "230:235:255");
    defaults.put(TABLE_OPT_FIELD_BACKGROUND, "230:255:230");
    defaults.put(TABLE_TEXT, "0:0:0");
    defaults.put(GRID_COLOR, "210:210:210");
    defaults.put(GRAYED_OUT_BACKGROUND, "210:210:210");
    defaults.put(GRAYED_OUT_TEXT, "40:40:40");
    defaults.put(VERY_GRAYED_OUT_BACKGROUND, "180:180:180");
    defaults.put(VERY_GRAYED_OUT_TEXT, "40:40:40");
    defaults.put(MARKED_ENTRY_BACKGROUND0, "255:255:180");
    defaults.put(MARKED_ENTRY_BACKGROUND1, "255:220:180");
    defaults.put(MARKED_ENTRY_BACKGROUND2, "255:180:160");
    defaults.put(MARKED_ENTRY_BACKGROUND3, "255:120:120");
    defaults.put(MARKED_ENTRY_BACKGROUND4, "255:75:75");
    defaults.put(MARKED_ENTRY_BACKGROUND5, "220:255:220");
    defaults.put(VALID_FIELD_BACKGROUND_COLOR, "255:255:255");
    defaults.put(INVALID_FIELD_BACKGROUND_COLOR, "255:0:0");
    defaults.put(ACTIVE_FIELD_EDITOR_BACKGROUND_COLOR, "220:220:255");
    defaults.put(FIELD_EDITOR_TEXT_COLOR, "0:0:0");

    defaults.put(INCOMPLETE_ENTRY_BACKGROUND, "250:175:175");

    defaults.put(CTRL_CLICK, Boolean.FALSE);
    defaults.put(DISABLE_ON_MULTIPLE_SELECTION, Boolean.FALSE);
    defaults.put(URL_COLUMN, Boolean.TRUE);
    defaults.put(PREFER_URL_DOI, Boolean.FALSE);
    defaults.put(FILE_COLUMN, Boolean.TRUE);
    defaults.put(ARXIV_COLUMN, Boolean.FALSE);

    defaults.put(EXTRA_FILE_COLUMNS, Boolean.FALSE);
    defaults.put(LIST_OF_FILE_COLUMNS, "");

    // OpenOffice/LibreOffice
    if (OS.WINDOWS) {
        defaults.put(JabRefPreferences.OO_PATH, OpenOfficePreferences.DEFAULT_WINDOWS_PATH);
        defaults.put(JabRefPreferences.OO_EXECUTABLE_PATH, OpenOfficePreferences.DEFAULT_WINDOWS_PATH
                + OpenOfficePreferences.WINDOWS_EXECUTABLE_SUBPATH + OpenOfficePreferences.WINDOWS_EXECUTABLE);
        defaults.put(JabRefPreferences.OO_JARS_PATH,
                OpenOfficePreferences.DEFAULT_WINDOWS_PATH + OpenOfficePreferences.WINDOWS_JARS_SUBPATH);
    } else if (OS.OS_X) {
        defaults.put(JabRefPreferences.OO_PATH, OpenOfficePreferences.DEFAULT_OSX_PATH);
        defaults.put(JabRefPreferences.OO_EXECUTABLE_PATH, OpenOfficePreferences.DEFAULT_OSX_PATH
                + OpenOfficePreferences.OSX_EXECUTABLE_SUBPATH + OpenOfficePreferences.OSX_EXECUTABLE);
        defaults.put(JabRefPreferences.OO_JARS_PATH,
                OpenOfficePreferences.DEFAULT_OSX_PATH + OpenOfficePreferences.OSX_JARS_SUBPATH);
    } else { // Linux
        defaults.put(JabRefPreferences.OO_PATH, "/opt/openoffice.org3");
        defaults.put(JabRefPreferences.OO_EXECUTABLE_PATH, "/usr/lib/openoffice/program/soffice");
        defaults.put(JabRefPreferences.OO_JARS_PATH, "/opt/openoffice.org/basis3.0");
    }

    defaults.put(JabRefPreferences.OO_SYNC_WHEN_CITING, false);
    defaults.put(JabRefPreferences.OO_SHOW_PANEL, false);
    defaults.put(JabRefPreferences.OO_USE_ALL_OPEN_BASES, true);
    defaults.put(JabRefPreferences.OO_BIBLIOGRAPHY_STYLE_FILE, StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH);
    defaults.put(JabRefPreferences.OO_EXTERNAL_STYLE_FILES, "");
    defaults.put(STYLES_POS_X, 0);
    defaults.put(STYLES_POS_Y, 0);
    defaults.put(STYLES_SIZE_X, 600);
    defaults.put(STYLES_SIZE_Y, 400);

    defaults.put(SpecialFieldsUtils.PREF_SPECIALFIELDSENABLED,
            SpecialFieldsUtils.PREF_SPECIALFIELDSENABLED_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SHOWCOLUMN_PRIORITY,
            SpecialFieldsUtils.PREF_SHOWCOLUMN_PRIORITY_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SHOWCOLUMN_QUALITY,
            SpecialFieldsUtils.PREF_SHOWCOLUMN_QUALITY_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SHOWCOLUMN_RANKING,
            SpecialFieldsUtils.PREF_SHOWCOLUMN_RANKING_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SHOWCOLUMN_RELEVANCE,
            SpecialFieldsUtils.PREF_SHOWCOLUMN_RELEVANCE_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SHOWCOLUMN_PRINTED,
            SpecialFieldsUtils.PREF_SHOWCOLUMN_PRINTED_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SHOWCOLUMN_READ, SpecialFieldsUtils.PREF_SHOWCOLUMN_READ_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_AUTOSYNCSPECIALFIELDSTOKEYWORDS,
            SpecialFieldsUtils.PREF_AUTOSYNCSPECIALFIELDSTOKEYWORDS_DEFAULT);
    defaults.put(SpecialFieldsUtils.PREF_SERIALIZESPECIALFIELDS,
            SpecialFieldsUtils.PREF_SERIALIZESPECIALFIELDS_DEFAULT);

    defaults.put(USE_OWNER, Boolean.FALSE);
    defaults.put(OVERWRITE_OWNER, Boolean.FALSE);
    defaults.put(DIALOG_WARNING_FOR_DUPLICATE_KEY, Boolean.TRUE);
    defaults.put(DIALOG_WARNING_FOR_EMPTY_KEY, Boolean.TRUE);
    defaults.put(DISPLAY_KEY_WARNING_DIALOG_AT_STARTUP, Boolean.TRUE);
    defaults.put(AVOID_OVERWRITING_KEY, Boolean.FALSE);
    defaults.put(WARN_BEFORE_OVERWRITING_KEY, Boolean.TRUE);
    defaults.put(CONFIRM_DELETE, Boolean.TRUE);
    defaults.put(GRAY_OUT_NON_HITS, Boolean.TRUE);
    defaults.put(SEARCH_MODE_FLOAT, Boolean.FALSE);
    defaults.put(DEFAULT_LABEL_PATTERN, "[authors3][year]");
    defaults.put(PREVIEW_ENABLED, Boolean.TRUE);
    defaults.put(ACTIVE_PREVIEW, 0);
    defaults.put(PREVIEW_0, "<font face=\"sans-serif\">"
            + "<b><i>\\bibtextype</i><a name=\"\\bibtexkey\">\\begin{bibtexkey} (\\bibtexkey)</a>"
            + "\\end{bibtexkey}</b><br>__NEWLINE__"
            + "\\begin{author} \\format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\\author}<BR>\\end{author}__NEWLINE__"
            + "\\begin{editor} \\format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\\editor} "
            + "<i>(\\format[IfPlural(Eds.,Ed.)]{\\editor})</i><BR>\\end{editor}__NEWLINE__"
            + "\\begin{title} \\format[HTMLChars]{\\title} \\end{title}<BR>__NEWLINE__"
            + "\\begin{chapter} \\format[HTMLChars]{\\chapter}<BR>\\end{chapter}__NEWLINE__"
            + "\\begin{journal} <em>\\format[HTMLChars]{\\journal}, </em>\\end{journal}__NEWLINE__"
            // Include the booktitle field for @inproceedings, @proceedings, etc.
            + "\\begin{booktitle} <em>\\format[HTMLChars]{\\booktitle}, </em>\\end{booktitle}__NEWLINE__"
            + "\\begin{school} <em>\\format[HTMLChars]{\\school}, </em>\\end{school}__NEWLINE__"
            + "\\begin{institution} <em>\\format[HTMLChars]{\\institution}, </em>\\end{institution}__NEWLINE__"
            + "\\begin{publisher} <em>\\format[HTMLChars]{\\publisher}, </em>\\end{publisher}__NEWLINE__"
            + "\\begin{year}<b>\\year</b>\\end{year}\\begin{volume}<i>, \\volume</i>\\end{volume}"
            + "\\begin{pages}, \\format[FormatPagesForHTML]{\\pages} \\end{pages}__NEWLINE__"
            + "\\begin{abstract}<BR><BR><b>Abstract: </b> \\format[HTMLChars]{\\abstract} \\end{abstract}__NEWLINE__"
            + "\\begin{review}<BR><BR><b>Review: </b> \\format[HTMLChars]{\\review} \\end{review}"
            + "</dd>__NEWLINE__<p></p></font>");
    defaults.put(PREVIEW_1, "<font face=\"sans-serif\">"
            + "<b><i>\\bibtextype</i><a name=\"\\bibtexkey\">\\begin{bibtexkey} (\\bibtexkey)</a>"
            + "\\end{bibtexkey}</b><br>__NEWLINE__"
            + "\\begin{author} \\format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\\author}<BR>\\end{author}__NEWLINE__"
            + "\\begin{editor} \\format[Authors(LastFirst,Initials,Semicolon,Amp),HTMLChars]{\\editor} "
            + "<i>(\\format[IfPlural(Eds.,Ed.)]{\\editor})</i><BR>\\end{editor}__NEWLINE__"
            + "\\begin{title} \\format[HTMLChars]{\\title} \\end{title}<BR>__NEWLINE__"
            + "\\begin{chapter} \\format[HTMLChars]{\\chapter}<BR>\\end{chapter}__NEWLINE__"
            + "\\begin{journal} <em>\\format[HTMLChars]{\\journal}, </em>\\end{journal}__NEWLINE__"
            // Include the booktitle field for @inproceedings, @proceedings, etc.
            + "\\begin{booktitle} <em>\\format[HTMLChars]{\\booktitle}, </em>\\end{booktitle}__NEWLINE__"
            + "\\begin{school} <em>\\format[HTMLChars]{\\school}, </em>\\end{school}__NEWLINE__"
            + "\\begin{institution} <em>\\format[HTMLChars]{\\institution}, </em>\\end{institution}__NEWLINE__"
            + "\\begin{publisher} <em>\\format[HTMLChars]{\\publisher}, </em>\\end{publisher}__NEWLINE__"
            + "\\begin{year}<b>\\year</b>\\end{year}\\begin{volume}<i>, \\volume</i>\\end{volume}"
            + "\\begin{pages}, \\format[FormatPagesForHTML]{\\pages} \\end{pages}"
            + "</dd>__NEWLINE__<p></p></font>");

    // TODO: Currently not possible to edit this setting:
    defaults.put(PREVIEW_PRINT_BUTTON, Boolean.FALSE);
    defaults.put(DO_NOT_RESOLVE_STRINGS_FOR, "url");
    defaults.put(RESOLVE_STRINGS_ALL_FIELDS, Boolean.FALSE);
    defaults.put(PUT_BRACES_AROUND_CAPITALS, "");//"title;journal;booktitle;review;abstract");
    defaults.put(NON_WRAPPABLE_FIELDS, "pdf;ps;url;doi;file");
    defaults.put(GENERATE_KEYS_AFTER_INSPECTION, Boolean.TRUE);
    defaults.put(MARK_IMPORTED_ENTRIES, Boolean.TRUE);
    defaults.put(UNMARK_ALL_ENTRIES_BEFORE_IMPORTING, Boolean.TRUE);
    defaults.put(WARN_ABOUT_DUPLICATES_IN_INSPECTION, Boolean.TRUE);
    defaults.put(USE_TIME_STAMP, Boolean.FALSE);
    defaults.put(OVERWRITE_TIME_STAMP, Boolean.FALSE);

    // default time stamp follows ISO-8601. Reason: https://xkcd.com/1179/
    defaults.put(TIME_STAMP_FORMAT, "yyyy-MM-dd");

    defaults.put(TIME_STAMP_FIELD, InternalBibtexFields.TIMESTAMP);
    defaults.put(UPDATE_TIMESTAMP, Boolean.FALSE);

    defaults.put(GENERATE_KEYS_BEFORE_SAVING, Boolean.FALSE);

    defaults.put(RemotePreferences.USE_REMOTE_SERVER, Boolean.TRUE);
    defaults.put(RemotePreferences.REMOTE_SERVER_PORT, 6050);

    defaults.put(PERSONAL_JOURNAL_LIST, "");
    defaults.put(EXTERNAL_JOURNAL_LISTS, "");
    defaults.put(CITE_COMMAND, "\\cite"); // obsoleted by the app-specific ones (not any more?)
    defaults.put(FLOAT_MARKED_ENTRIES, Boolean.TRUE);

    defaults.put(LAST_USED_EXPORT, "");
    defaults.put(SIDE_PANE_WIDTH, -1);

    defaults.put(IMPORT_INSPECTION_DIALOG_WIDTH, 650);
    defaults.put(IMPORT_INSPECTION_DIALOG_HEIGHT, 650);
    defaults.put(SEARCH_DIALOG_WIDTH, 650);
    defaults.put(SEARCH_DIALOG_HEIGHT, 500);
    defaults.put(SHOW_FILE_LINKS_UPGRADE_WARNING, Boolean.TRUE);
    defaults.put(AUTOLINK_EXACT_KEY_ONLY, Boolean.FALSE);
    defaults.put(NUMERIC_FIELDS, "mittnum;author");
    defaults.put(RUN_AUTOMATIC_FILE_SEARCH, Boolean.FALSE);
    defaults.put(USE_LOCK_FILES, Boolean.TRUE);
    defaults.put(AUTO_SAVE, Boolean.TRUE);
    defaults.put(AUTO_SAVE_INTERVAL, 5);
    defaults.put(PROMPT_BEFORE_USING_AUTOSAVE, Boolean.TRUE);
    defaults.put(ENFORCE_LEGAL_BIBTEX_KEY, Boolean.TRUE);
    // Curly brackets ({}) are the default delimiters, not quotes (") as these cause trouble when they appear within the field value:
    // Currently, JabRef does not escape them
    defaults.put(VALUE_DELIMITERS2, 1);
    defaults.put(KEY_GEN_FIRST_LETTER_A, Boolean.TRUE);
    defaults.put(KEY_GEN_ALWAYS_ADD_LETTER, Boolean.FALSE);
    defaults.put(EMAIL_SUBJECT, Localization.lang("References"));
    defaults.put(OPEN_FOLDERS_OF_ATTACHED_FILES, Boolean.FALSE);
    defaults.put(ALLOW_FILE_AUTO_OPEN_BROWSE, Boolean.TRUE);
    defaults.put(WEB_SEARCH_VISIBLE, Boolean.FALSE);
    defaults.put(SELECTED_FETCHER_INDEX, 0);
    defaults.put(BIB_LOC_AS_PRIMARY_DIR, Boolean.FALSE);
    defaults.put(DB_CONNECT_SERVER_TYPE, "MySQL");
    defaults.put(DB_CONNECT_HOSTNAME, "localhost");
    defaults.put(DB_CONNECT_DATABASE, "jabref");
    defaults.put(DB_CONNECT_USERNAME, "root");

    defaults.put(AKS_AUTO_NAMING_PDFS_AGAIN, Boolean.TRUE);
    insertCleanupPreset(defaults, CLEANUP_DEFAULT_PRESET);

    // defaults for DroppedFileHandler UI
    defaults.put(DroppedFileHandler.DFH_LEAVE, Boolean.FALSE);
    defaults.put(DroppedFileHandler.DFH_COPY, Boolean.TRUE);
    defaults.put(DroppedFileHandler.DFH_MOVE, Boolean.FALSE);
    defaults.put(DroppedFileHandler.DFH_RENAME, Boolean.FALSE);

    //defaults.put("lastAutodetectedImport", "");
    //defaults.put("autoRemoveExactDuplicates", Boolean.FALSE);
    //defaults.put("confirmAutoRemoveExactDuplicates", Boolean.TRUE);
    //defaults.put("tempDir", System.getProperty("java.io.tmpdir"));
    LOGGER.debug("Temporary directory: " + System.getProperty("java.io.tempdir"));
    //defaults.put("keyPattern", new LabelPattern(KEY_PATTERN));

    defaults.put(PREF_IMPORT_ALWAYSUSE, Boolean.FALSE);
    defaults.put(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, ImportSettingsTab.DEFAULT_STYLE);

    // use BibTeX key appended with filename as default pattern
    defaults.put(PREF_IMPORT_FILENAMEPATTERN, ImportSettingsTab.DEFAULT_FILENAMEPATTERNS[1]);

    customExports = new CustomExportList(new ExportComparator());
    customImports = new CustomImportList(this);

    updateSpecialFieldHandling();
    WRAPPED_USERNAME = '[' + get(DEFAULT_OWNER) + ']';
    MARKING_WITH_NUMBER_PATTERN = "\\[" + get(DEFAULT_OWNER).replaceAll("\\\\", "\\\\\\\\") + ":(\\d+)\\]";

    String defaultExpression = "**/.*[bibtexkey].*\\\\.[extension]";
    defaults.put(DEFAULT_REG_EXP_SEARCH_EXPRESSION_KEY, defaultExpression);
    defaults.put(REG_EXP_SEARCH_EXPRESSION_KEY, defaultExpression);
    defaults.put(AUTOLINK_USE_REG_EXP_SEARCH_KEY, Boolean.FALSE);
    defaults.put(USE_IEEE_ABRV, Boolean.FALSE);
    defaults.put(USE_CONVERT_TO_EQUATION, Boolean.FALSE);
    defaults.put(USE_CASE_KEEPER_ON_SEARCH, Boolean.TRUE);
    defaults.put(USE_UNIT_FORMATTER_ON_SEARCH, Boolean.TRUE);
}