diff --git a/.classpath b/.classpath index 55678f7..253ef2b 100644 --- a/.classpath +++ b/.classpath @@ -2,9 +2,9 @@ - - + + - + diff --git a/.gitignore b/.gitignore index 1604dee..2f9fe26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/bin/ +/bin/com/ #/jars/ diff --git a/bin/JcifsFile2-1.0.9.jar b/bin/JcifsFile2-1.0.9.jar new file mode 100644 index 0000000..f09e137 Binary files /dev/null and b/bin/JcifsFile2-1.0.9.jar differ diff --git a/jars/WrapperForSlf4j-1.0.2.jar b/jars/WrapperForSlf4j-1.0.2.jar deleted file mode 100644 index 187bc26..0000000 Binary files a/jars/WrapperForSlf4j-1.0.2.jar and /dev/null differ diff --git a/jars/WrapperForSlf4j-1.7.36.jar b/jars/WrapperForSlf4j-1.7.36.jar new file mode 100644 index 0000000..1a5750a Binary files /dev/null and b/jars/WrapperForSlf4j-1.7.36.jar differ diff --git a/jars/jcifs-1.3.17_patch.jar b/jars/jcifs-1.3.17_patch.jar deleted file mode 100644 index 882adad..0000000 Binary files a/jars/jcifs-1.3.17_patch.jar and /dev/null differ diff --git a/jars/jcifs-ng-2.1.6-20201207-01.jar b/jars/jcifs-ng-2.1.6-20201207-01.jar deleted file mode 100644 index 2ac2efa..0000000 Binary files a/jars/jcifs-ng-2.1.6-20201207-01.jar and /dev/null differ diff --git a/jars/jcifs13-1.3.19.jar b/jars/jcifs13-1.3.19.jar new file mode 100644 index 0000000..ac1a3e1 Binary files /dev/null and b/jars/jcifs13-1.3.19.jar differ diff --git a/jars/jcifsng-latest.jar b/jars/jcifsng-latest.jar new file mode 100644 index 0000000..a15d9d3 Binary files /dev/null and b/jars/jcifsng-latest.jar differ diff --git a/src/com/sentaroh/android/JcifsFile2/JcifsAuth.java b/src/com/sentaroh/android/JcifsFile2/JcifsAuth.java index 49b9848..2b2ad9e 100644 --- a/src/com/sentaroh/android/JcifsFile2/JcifsAuth.java +++ b/src/com/sentaroh/android/JcifsFile2/JcifsAuth.java @@ -28,8 +28,12 @@ this software and associated documentation files (the "Software"), to deal public class JcifsAuth { final static public String JCIFS_FILE_SMB1 = "SMBv1"; final static public String JCIFS_FILE_SMB23 = "SMBv2/3"; - private jcifs.smb.NtlmPasswordAuthentication mSmb1Auth = null; - private jcifsng.CIFSContext mSmb23Auth = null; + + final static public String SMB_CLIENT_MIN_VERSION = "SMB202"; //prop jcifs.smb.client.minVersion + final static public String SMB_CLIENT_MAX_VERSION = "SMB311"; //prop jcifs.smb.client.maxVersion + + private jcifs13.smb.NtlmPasswordAuthentication mSmb1Auth = null; + private jcifs.CIFSContext mSmb23Auth = null; private String mSmbLevel = JCIFS_FILE_SMB23; private String mDomain = null, mUserName = null, mUserPass = null; @@ -44,7 +48,7 @@ public class JcifsAuth { * @throws JcifsException */ public JcifsAuth(String smb_level, String domain, String user, String pass) throws JcifsException { - init_type(smb_level, domain, user, pass, "SMB202", "SMB311", new Properties()); + init_type(smb_level, domain, user, pass, SMB_CLIENT_MIN_VERSION, SMB_CLIENT_MAX_VERSION, new Properties()); } /** @@ -58,7 +62,7 @@ public JcifsAuth(String smb_level, String domain, String user, String pass) thro * @throws JcifsException */ public JcifsAuth(String smb_level, String domain, String user, String pass, Properties prop) throws JcifsException { - init_type(smb_level, domain, user, pass, "SMB202", "SMB311", prop); + init_type(smb_level, domain, user, pass, SMB_CLIENT_MIN_VERSION, SMB_CLIENT_MAX_VERSION, prop); } /** @@ -98,17 +102,17 @@ private void init_type(String smb_level, String domain, String user, String pass mUserName = user; mUserPass = pass; if (isSmb1()) { - mSmb1Auth = new jcifs.smb.NtlmPasswordAuthentication(domain, user, pass); + mSmb1Auth = new jcifs13.smb.NtlmPasswordAuthentication(domain, user, pass); } else if (isSmb23()) { try { Properties prop_new = new Properties(prop); prop_new.setProperty("jcifs.smb.client.minVersion", min_version); prop_new.setProperty("jcifs.smb.client.maxVersion", max_version); - jcifsng.context.BaseContext bc = new jcifsng.context.BaseContext(new jcifsng.config.PropertyConfiguration(prop_new)); - jcifsng.smb.NtlmPasswordAuthenticator creds = new jcifsng.smb.NtlmPasswordAuthenticator(domain, user, pass); + jcifs.context.BaseContext bc = new jcifs.context.BaseContext(new jcifs.config.PropertyConfiguration(prop_new)); + jcifs.smb.NtlmPasswordAuthenticator creds = new jcifs.smb.NtlmPasswordAuthenticator(domain, user, pass); mSmb23Auth = bc.withCredentials(creds); - } catch (jcifsng.CIFSException e) { + } catch (jcifs.CIFSException e) { e.printStackTrace(); throw new JcifsException(e, -1, e.getCause()); } @@ -130,11 +134,11 @@ public boolean isSmb23() { return mSmbLevel.equals(JCIFS_FILE_SMB23); } - public jcifs.smb.NtlmPasswordAuthentication getSmb1Auth() { + public jcifs13.smb.NtlmPasswordAuthentication getSmb1Auth() { return mSmb1Auth; } - public jcifsng.CIFSContext getSmb214Auth() { + public jcifs.CIFSContext getSmb214Auth() { return mSmb23Auth; } diff --git a/src/com/sentaroh/android/JcifsFile2/JcifsFile.java b/src/com/sentaroh/android/JcifsFile2/JcifsFile.java index 0a0df5c..f85d949 100644 --- a/src/com/sentaroh/android/JcifsFile2/JcifsFile.java +++ b/src/com/sentaroh/android/JcifsFile2/JcifsFile.java @@ -38,8 +38,8 @@ public class JcifsFile { private JcifsAuth mAuth = null; - private jcifsng.smb.SmbFile mSmb23File = null; - private jcifs.smb.SmbFile mSmb1File = null; + private jcifs.smb.SmbFile mSmb23File = null; + private jcifs13.smb.SmbFile mSmb1File = null; public JcifsFile(String url, JcifsAuth auth) throws MalformedURLException, JcifsException { if (auth==null) { @@ -49,13 +49,13 @@ public JcifsFile(String url, JcifsAuth auth) throws MalformedURLException, Jcifs mAuth = auth; if (mSmbLevel.equals(JCIFS_FILE_SMB1)) { - mSmb1File = new jcifs.smb.SmbFile(url, auth.getSmb1Auth()); + mSmb1File = new jcifs13.smb.SmbFile(url, auth.getSmb1Auth()); } else if (mSmbLevel.equals(JCIFS_FILE_SMB23)) { - mSmb23File = new jcifsng.smb.SmbFile(url, auth.getSmb214Auth()); + mSmb23File = new jcifs.smb.SmbFile(url, auth.getSmb214Auth()); } } - private JcifsFile(jcifs.smb.SmbFile smb1File, JcifsAuth auth) throws JcifsException { + private JcifsFile(jcifs13.smb.SmbFile smb1File, JcifsAuth auth) throws JcifsException { mSmbLevel = JCIFS_FILE_SMB1; if (auth==null || !auth.isSmb1()) { throw new JcifsException("JcifsAuth is null or SMB2."); @@ -64,7 +64,7 @@ private JcifsFile(jcifs.smb.SmbFile smb1File, JcifsAuth auth) throws JcifsExcept mSmb1File = smb1File; } - private JcifsFile(jcifsng.smb.SmbFile smb214File, JcifsAuth auth) throws JcifsException { + private JcifsFile(jcifs.smb.SmbFile smb214File, JcifsAuth auth) throws JcifsException { mSmbLevel = JCIFS_FILE_SMB23; if (auth==null || auth.isSmb1()) { throw new JcifsException("JcifsAuth is null or SMB1."); @@ -81,11 +81,11 @@ public boolean isSmb214File() { return mSmbLevel.equals(JCIFS_FILE_SMB23); } - public jcifs.smb.SmbFile getSmb1File() { + public jcifs13.smb.SmbFile getSmb1File() { return mSmb1File; } - public jcifsng.smb.SmbFile getSmb214File() { + public jcifs.smb.SmbFile getSmb214File() { return mSmb23File; } @@ -97,10 +97,10 @@ public boolean exists() throws JcifsException { return mSmb23File.exists(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -113,10 +113,10 @@ public void delete() throws JcifsException { mSmb23File.delete(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -129,10 +129,10 @@ public void mkdir() throws JcifsException { mSmb23File.mkdir(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -144,10 +144,10 @@ public void mkdirs() throws JcifsException { mSmb23File.mkdirs(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -159,10 +159,10 @@ public int getAttributes() throws JcifsException { return mSmb23File.getAttributes(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -174,10 +174,10 @@ public InputStream getInputStream() throws JcifsException { return mSmb23File.getInputStream(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (IOException e) { throw (new JcifsException(e, 0, e.getCause())); } @@ -192,10 +192,10 @@ public OutputStream getOutputStream() throws JcifsException { return mSmb23File.getOutputStream(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (IOException e) { throw (new JcifsException(e, 0, e.getCause())); } @@ -219,10 +219,10 @@ public void connect() throws JcifsException { mSmb23File.connect(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (IOException e) { throw (new JcifsException(e, 0, e.getCause())); } @@ -236,10 +236,10 @@ public void createNew() throws JcifsException { mSmb23File.createNewFile(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -287,10 +287,10 @@ public int getType() throws JcifsException { return mSmb23File.getType(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -320,10 +320,10 @@ public boolean canRead() throws JcifsException { return mSmb23File.canRead(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -335,10 +335,10 @@ public boolean canWrite() throws JcifsException { return mSmb23File.canWrite(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -350,10 +350,10 @@ public boolean isDirectory() throws JcifsException { return mSmb23File.isDirectory(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -365,10 +365,10 @@ public boolean isFile() throws JcifsException { return mSmb23File.isFile(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -380,10 +380,10 @@ public boolean isHidden() throws JcifsException { return mSmb23File.isHidden(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -395,10 +395,10 @@ public long length() throws JcifsException { return mSmb23File.length(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -410,24 +410,24 @@ public String[] list() throws JcifsException { return mSmb23File.list(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } public JcifsFile[] listFiles() throws JcifsException { try { if (mSmbLevel.equals(JCIFS_FILE_SMB1)) { - jcifs.smb.SmbFile[] smb1Files = mSmb1File.listFiles(); + jcifs13.smb.SmbFile[] smb1Files = mSmb1File.listFiles(); if (smb1Files == null) return null; JcifsFile[] result = new JcifsFile[smb1Files.length]; for (int i = 0; i < smb1Files.length; i++) result[i] = new JcifsFile(smb1Files[i], mAuth); return result; } else if (mSmbLevel.equals(JCIFS_FILE_SMB23)) { - jcifsng.smb.SmbFile[] smb214Files = mSmb23File.listFiles(); + jcifs.smb.SmbFile[] smb214Files = mSmb23File.listFiles(); if (smb214Files == null) return null; JcifsFile[] result = new JcifsFile[smb214Files.length]; for (int i = 0; i < smb214Files.length; i++) @@ -435,10 +435,10 @@ public JcifsFile[] listFiles() throws JcifsException { return result; } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -454,10 +454,10 @@ public void renameTo(JcifsFile d) throws JcifsException { else mSmb23File.renameTo(d.getSmb214File()); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -474,10 +474,10 @@ public void setLastModified(long lm) throws JcifsException { mSmb23File.setLastModified(lm); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } @@ -489,10 +489,10 @@ public long getLastModified() throws JcifsException { return mSmb23File.lastModified(); } else throw (new JcifsException(JcifsException.NT_STATUS_DESC_INVALID_JCIFS_LEVEL, JcifsException.NT_STATUS_INT_INVALID_JCIFS_LEVEL)); - } catch (jcifsng.smb.SmbException e) { - throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } catch (jcifs.smb.SmbException e) { throw (new JcifsException(e, e.getNtStatus(), e.getCause())); + } catch (jcifs13.smb.SmbException e) { + throw (new JcifsException(e, e.getNtStatus(), e.getCause())); } } diff --git a/src/com/sentaroh/android/JcifsFile2/JcifsUtil.java b/src/com/sentaroh/android/JcifsFile2/JcifsUtil.java index 9badb67..b631958 100644 --- a/src/com/sentaroh/android/JcifsFile2/JcifsUtil.java +++ b/src/com/sentaroh/android/JcifsFile2/JcifsUtil.java @@ -79,7 +79,7 @@ final static public String getSmbHostIpAddressByHostName(String smb_level, Strin final static private String getSmbHostIpAddressFromNameSmb1(String hn) { String ipAddress = null; try { - jcifs.netbios.NbtAddress nbtAddress = jcifs.netbios.NbtAddress.getByName(hn); + jcifs13.netbios.NbtAddress nbtAddress = jcifs13.netbios.NbtAddress.getByName(hn); InetAddress address = nbtAddress.getInetAddress(); ipAddress = address.getHostAddress(); } catch (UnknownHostException e) { @@ -93,11 +93,11 @@ final static private String getSmbHostIpAddressFromNameSmb1(String hn) { final static private String getSmbHostIpAddressFromNameSmb23(String hn) { String ipAddress = null; try { - jcifsng.context.BaseContext bc = new jcifsng.context.BaseContext(new jcifsng.config.PropertyConfiguration(System.getProperties())); + jcifs.context.BaseContext bc = new jcifs.context.BaseContext(new jcifs.config.PropertyConfiguration(System.getProperties())); ipAddress = bc.getNameServiceClient().getByName(hn).getHostAddress(); } catch (UnknownHostException e) { log.error("getSmbHostIpAddressFromNameSmb23 UnknownHostException", e); - } catch (jcifsng.CIFSException e) { + } catch (jcifs.CIFSException e) { log.error("getSmbHostIpAddressFromNameSmb23 CIFSException", e); } catch (Exception e) { log.error("getSmbHostIpAddressFromNameSmb23 Exception", e); @@ -133,10 +133,10 @@ final static public String getSmbHostNameByAddress(String smb_level, String addr final static private String getSmbHostNameFromAddressSmb1(String address) { String srv_name = ""; try { - jcifs.netbios.NbtAddress[] uax = jcifs.netbios.NbtAddress.getAllByAddress(address); + jcifs13.netbios.NbtAddress[] uax = jcifs13.netbios.NbtAddress.getAllByAddress(address); if (uax != null) { for (int i = 0; i < uax.length; i++) { - jcifs.netbios.NbtAddress ua = uax[i]; + jcifs13.netbios.NbtAddress ua = uax[i]; String hn; hn = ua.firstCalledName(); if (ua.getNameType() == 32) { @@ -156,11 +156,11 @@ final static private String getSmbHostNameFromAddressSmb1(String address) { final static private String getSmbHostNameFromAddressSmb23(String address) { String srv_name = ""; try { - jcifsng.context.BaseContext bc = new jcifsng.context.BaseContext(new jcifsng.config.PropertyConfiguration(System.getProperties())); - jcifsng.NetbiosAddress[] uax = bc.getNameServiceClient().getNbtAllByAddress(address); + jcifs.context.BaseContext bc = new jcifs.context.BaseContext(new jcifs.config.PropertyConfiguration(System.getProperties())); + jcifs.NetbiosAddress[] uax = bc.getNameServiceClient().getNbtAllByAddress(address); if (uax != null) { for (int i = 0; i < uax.length; i++) { - jcifsng.NetbiosAddress ua = uax[i]; + jcifs.NetbiosAddress ua = uax[i]; String hn; hn = ua.firstCalledName(); if (ua.getNameType() == 32) { @@ -171,7 +171,7 @@ final static private String getSmbHostNameFromAddressSmb23(String address) { } } catch (UnknownHostException e) { log.error("getSmbHostNameFromAddressSmb23 UnknownHostException", e); - } catch (jcifsng.CIFSException e) { + } catch (jcifs.CIFSException e) { log.error("getSmbHostNameFromAddressSmb23 CIFSException", e); } catch (Exception e) { log.error("getSmbHostNameFromAddressSmb23 Exception", e); @@ -191,7 +191,7 @@ final static public boolean isNetbiosAddress(String smb_level, String address) { final static private boolean isNbtAddressActiveSmb1(String address) { boolean result = false; try { - jcifs.netbios.NbtAddress na = jcifs.netbios.NbtAddress.getByName(address); + jcifs13.netbios.NbtAddress na = jcifs13.netbios.NbtAddress.getByName(address); result = na.isActive(); } catch (UnknownHostException e) { log.error("isNbtAddressActiveSmb1 UnknownHostException", e); @@ -204,12 +204,12 @@ final static private boolean isNbtAddressActiveSmb1(String address) { final static private boolean isNbtAddressActiveSmb214(String address) { boolean result = false; try { - jcifsng.context.BaseContext bc = new jcifsng.context.BaseContext(new jcifsng.config.PropertyConfiguration(System.getProperties())); - jcifsng.NetbiosAddress na = bc.getNameServiceClient().getNbtByName(address); + jcifs.context.BaseContext bc = new jcifs.context.BaseContext(new jcifs.config.PropertyConfiguration(System.getProperties())); + jcifs.NetbiosAddress na = bc.getNameServiceClient().getNbtByName(address); result = na.isActive(bc); } catch (UnknownHostException e) { log.error("isNbtAddressActiveSmb2 UnknownHostException", e); - } catch (jcifsng.CIFSException e) { + } catch (jcifs.CIFSException e) { log.error("isNbtAddressActiveSmb2 CIFSException", e); } catch (Exception e) { log.error("isNbtAddressActiveSmb2 Exception", e);