Skip to content

Commit f9c6125

Browse files
author
Zhen Li
committed
Merge pull request #145 from jakewins/1.0-neo4j-home
Change known_hosts to .neo4j/known_hosts
2 parents 804a2f1 + 7230f48 commit f9c6125

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

driver/src/main/java/org/neo4j/driver/internal/InternalDriver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.neo4j.driver.v1.Config;
2727
import org.neo4j.driver.v1.Driver;
2828
import org.neo4j.driver.v1.Session;
29+
import org.neo4j.driver.v1.exceptions.Neo4jException;
2930

3031
public class InternalDriver implements Driver
3132
{
@@ -55,7 +56,7 @@ public Session session()
5556
* Close all the resources assigned to this driver
5657
* @throws Exception any error that might happen when releasing all resources
5758
*/
58-
public void close() throws Exception
59+
public void close() throws Neo4jException
5960
{
6061
connections.close();
6162
}

driver/src/main/java/org/neo4j/driver/internal/pool/InternalConnectionPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.neo4j.driver.v1.AuthToken;
3737
import org.neo4j.driver.v1.Config;
3838
import org.neo4j.driver.v1.exceptions.ClientException;
39+
import org.neo4j.driver.v1.exceptions.Neo4jException;
3940

4041
/**
4142
* A basic connection pool that optimizes for threads being long-lived, acquiring/releasing many connections.
@@ -156,7 +157,7 @@ private static Collection<Connector> loadConnectors()
156157
}
157158

158159
@Override
159-
public void close() throws Exception
160+
public void close() throws Neo4jException
160161
{
161162
for ( ThreadCachingPool<PooledConnection> pool : pools.values() )
162163
{

driver/src/main/java/org/neo4j/driver/v1/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static class ConfigBuilder
142142
private long idleTimeBeforeConnectionTest = 200;
143143
private EncryptionLevel encruptionLevel = EncryptionLevel.REQUIRED;
144144
private TrustStrategy trustStrategy = trustOnFirstUse(
145-
new File( getProperty( "user.home" ), ".neo4j/neo4j_known_hosts" ) );
145+
new File( getProperty( "user.home" ), ".neo4j" + File.separator + "known_hosts" ) );
146146

147147
private ConfigBuilder() {}
148148

driver/src/main/java/org/neo4j/driver/v1/Driver.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import java.net.URI;
2222

23+
import org.neo4j.driver.v1.exceptions.Neo4jException;
24+
2325
/**
2426
* A Neo4j database driver, through which you can create {@link Session sessions} to run statements against the database.
2527
* <p>
@@ -78,7 +80,7 @@ public interface Driver extends AutoCloseable
7880

7981
/**
8082
* Close all the resources assigned to this driver
81-
* @throws Exception any error that might happen when releasing all resources
83+
* @throws Neo4jException any error that might happen when releasing all resources
8284
*/
83-
void close() throws Exception;
85+
void close() throws Neo4jException;
8486
}

driver/src/test/java/org/neo4j/driver/internal/ConfigTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232
public class ConfigTest
3333
{
34-
private static final File DEFAULT_KNOWN_HOSTS = new File( getProperty( "user.home" ), ".neo4j/neo4j_known_hosts" );
34+
private static final File DEFAULT_KNOWN_HOSTS = new File( getProperty( "user.home" ),
35+
".neo4j" + File.separator + "known_hosts" );
3536

3637
@Test
3738
public void shouldDefaultToKnownCerts()

0 commit comments

Comments
 (0)