system.io.File Maven / Gradle / Ivy
/*
* MIT License
*
* Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
*
* This code was generated from a template using JCOReflector v. 1.14.0.0
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
*
*************************************************************************************/
package system.io;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.DateTime;
import system.io.FileAttributes;
import system.io.FileStream;
import system.io.FileOptions;
import system.security.accesscontrol.FileSecurity;
import system.io.FileMode;
import system.io.FileAccess;
import system.io.FileShare;
import system.io.StreamReader;
import system.io.StreamWriter;
import system.security.accesscontrol.AccessControlSections;
import system.text.Encoding;
/**
* The base .NET class managing System.IO.File, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
*
*
* .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.IO.File
*
*
* Powered by JCOBridge: more info at https://www.jcobridge.com
*
* @author MASES s.r.l https://masesgroup.com
* @version 1.14.0.0
*/
public class File extends NetObject {
/**
* Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
*/
public static final String assemblyFullName = "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
/**
* Assembly name: mscorlib
*/
public static final String assemblyShortName = "mscorlib";
/**
* Qualified class name: System.IO.File
*/
public static final String className = "System.IO.File";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
String classToCreate = className + ", "
+ (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Creating %s", classToCreate);
JCType typeCreated = bridge.GetType(classToCreate);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Created: %s",
(typeCreated != null) ? typeCreated.toString() : "Returned null value");
return typeCreated;
} catch (JCException e) {
JCOReflector.writeLog(e);
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* Internal constructor. Use with caution
*/
public File(java.lang.Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public java.lang.Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link File}, a cast assert is made to check if types are compatible.
* @param from {@link IJCOBridgeReflected} instance to be casted
* @return {@link File} instance
* @throws java.lang.Throwable in case of error during cast operation
*/
public static File cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new File(from.getJCOInstance());
}
// Constructors section
public File() throws Throwable {
}
// Methods section
public static boolean Exists(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (boolean)classType.Invoke("Exists", path);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static byte[] ReadAllBytes(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.EndOfStreamException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classType.Invoke("ReadAllBytes", path);
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(resultingObject);
}
byte[] resultingArray = new byte[resultingArrayList.size()];
for(int indexReadAllBytes = 0; indexReadAllBytes < resultingArrayList.size(); indexReadAllBytes++ ) {
resultingArray[indexReadAllBytes] = (byte)resultingArrayList.get(indexReadAllBytes);
}
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static DateTime GetCreationTime(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException, system.InvalidTimeZoneException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetCreationTime = (JCObject)classType.Invoke("GetCreationTime", path);
return new DateTime(objGetCreationTime);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static DateTime GetCreationTimeUtc(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetCreationTimeUtc = (JCObject)classType.Invoke("GetCreationTimeUtc", path);
return new DateTime(objGetCreationTimeUtc);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static DateTime GetLastAccessTime(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException, system.InvalidTimeZoneException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetLastAccessTime = (JCObject)classType.Invoke("GetLastAccessTime", path);
return new DateTime(objGetLastAccessTime);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static DateTime GetLastAccessTimeUtc(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetLastAccessTimeUtc = (JCObject)classType.Invoke("GetLastAccessTimeUtc", path);
return new DateTime(objGetLastAccessTimeUtc);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static DateTime GetLastWriteTime(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException, system.InvalidTimeZoneException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetLastWriteTime = (JCObject)classType.Invoke("GetLastWriteTime", path);
return new DateTime(objGetLastWriteTime);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static DateTime GetLastWriteTimeUtc(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetLastWriteTimeUtc = (JCObject)classType.Invoke("GetLastWriteTimeUtc", path);
return new DateTime(objGetLastWriteTimeUtc);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileAttributes GetAttributes(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.IndexOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetAttributes = (JCObject)classType.Invoke("GetAttributes", path);
return new FileAttributes(objGetAttributes);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Create(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objCreate = (JCObject)classType.Invoke("Create", path);
return new FileStream(objCreate);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Create(java.lang.String path, int bufferSize) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objCreate = (JCObject)classType.Invoke("Create", path, bufferSize);
return new FileStream(objCreate);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Create(java.lang.String path, int bufferSize, FileOptions options) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objCreate = (JCObject)classType.Invoke("Create", path, bufferSize, options == null ? null : options.getJCOInstance());
return new FileStream(objCreate);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Create(java.lang.String path, int bufferSize, FileOptions options, FileSecurity fileSecurity) throws Throwable, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.security.SecurityException, system.collections.generic.KeyNotFoundException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objCreate = (JCObject)classType.Invoke("Create", path, bufferSize, options == null ? null : options.getJCOInstance(), fileSecurity == null ? null : fileSecurity.getJCOInstance());
return new FileStream(objCreate);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Open(java.lang.String path, FileMode mode) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objOpen = (JCObject)classType.Invoke("Open", path, mode == null ? null : mode.getJCOInstance());
return new FileStream(objOpen);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Open(java.lang.String path, FileMode mode, FileAccess access) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objOpen = (JCObject)classType.Invoke("Open", path, mode == null ? null : mode.getJCOInstance(), access == null ? null : access.getJCOInstance());
return new FileStream(objOpen);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream Open(java.lang.String path, FileMode mode, FileAccess access, FileShare share) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objOpen = (JCObject)classType.Invoke("Open", path, mode == null ? null : mode.getJCOInstance(), access == null ? null : access.getJCOInstance(), share == null ? null : share.getJCOInstance());
return new FileStream(objOpen);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream OpenRead(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objOpenRead = (JCObject)classType.Invoke("OpenRead", path);
return new FileStream(objOpenRead);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileStream OpenWrite(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objOpenWrite = (JCObject)classType.Invoke("OpenWrite", path);
return new FileStream(objOpenWrite);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static StreamReader OpenText(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.ArgumentException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objOpenText = (JCObject)classType.Invoke("OpenText", path);
return new StreamReader(objOpenText);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static StreamWriter AppendText(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.ArgumentException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objAppendText = (JCObject)classType.Invoke("AppendText", path);
return new StreamWriter(objAppendText);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static StreamWriter CreateText(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.ArgumentException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objCreateText = (JCObject)classType.Invoke("CreateText", path);
return new StreamWriter(objCreateText);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileSecurity GetAccessControl(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.OutOfMemoryException, system.UnauthorizedAccessException, system.InvalidOperationException, system.security.accesscontrol.PrivilegeNotHeldException, system.SystemException, system.ArgumentOutOfRangeException, system.OverflowException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetAccessControl = (JCObject)classType.Invoke("GetAccessControl", path);
return new FileSecurity(objGetAccessControl);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static FileSecurity GetAccessControl(java.lang.String path, AccessControlSections includeSections) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.OutOfMemoryException, system.UnauthorizedAccessException, system.InvalidOperationException, system.security.accesscontrol.PrivilegeNotHeldException, system.SystemException, system.ArgumentOutOfRangeException, system.OverflowException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objGetAccessControl = (JCObject)classType.Invoke("GetAccessControl", path, includeSections == null ? null : includeSections.getJCOInstance());
return new FileSecurity(objGetAccessControl);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static java.lang.String ReadAllText(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.OutOfMemoryException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (java.lang.String)classType.Invoke("ReadAllText", path);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static java.lang.String ReadAllText(java.lang.String path, Encoding encoding) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.OutOfMemoryException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
return (java.lang.String)classType.Invoke("ReadAllText", path, encoding == null ? null : encoding.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static java.lang.String[] ReadAllLines(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.OutOfMemoryException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classType.Invoke("ReadAllLines", path);
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(resultingObject);
}
java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()];
for(int indexReadAllLines = 0; indexReadAllLines < resultingArrayList.size(); indexReadAllLines++ ) {
resultingArray[indexReadAllLines] = (java.lang.String)resultingArrayList.get(indexReadAllLines);
}
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static java.lang.String[] ReadAllLines(java.lang.String path, Encoding encoding) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.OutOfMemoryException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
ArrayList resultingArrayList = new ArrayList();
JCObject resultingObjects = (JCObject)classType.Invoke("ReadAllLines", path, encoding == null ? null : encoding.getJCOInstance());
for (java.lang.Object resultingObject : resultingObjects) {
resultingArrayList.add(resultingObject);
}
java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()];
for(int indexReadAllLines = 0; indexReadAllLines < resultingArrayList.size(); indexReadAllLines++ ) {
resultingArray[indexReadAllLines] = (java.lang.String)resultingArrayList.get(indexReadAllLines);
}
return resultingArray;
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void AppendAllText(java.lang.String path, java.lang.String contents) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.PathTooLongException, system.io.DriveNotFoundException, system.OperationCanceledException, system.security.SecurityException, system.FormatException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("AppendAllText", path, contents);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void AppendAllText(java.lang.String path, java.lang.String contents, Encoding encoding) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.PathTooLongException, system.io.DriveNotFoundException, system.OperationCanceledException, system.security.SecurityException, system.FormatException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("AppendAllText", path, contents, encoding == null ? null : encoding.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Copy(java.lang.String sourceFileName, java.lang.String destFileName) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Copy", sourceFileName, destFileName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Copy(java.lang.String sourceFileName, java.lang.String destFileName, boolean overwrite) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Copy", sourceFileName, destFileName, overwrite);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Decrypt(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.IndexOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Decrypt", path);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Delete(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Delete", path);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Encrypt(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.IndexOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Encrypt", path);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Move(java.lang.String sourceFileName, java.lang.String destFileName) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.InvalidOperationException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Move", sourceFileName, destFileName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Replace(java.lang.String sourceFileName, java.lang.String destinationFileName, java.lang.String destinationBackupFileName) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Replace", sourceFileName, destinationFileName, destinationBackupFileName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void Replace(java.lang.String sourceFileName, java.lang.String destinationFileName, java.lang.String destinationBackupFileName, boolean ignoreMetadataErrors) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("Replace", sourceFileName, destinationFileName, destinationBackupFileName, ignoreMetadataErrors);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetAccessControl(java.lang.String path, FileSecurity fileSecurity) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.IndexOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.security.accesscontrol.PrivilegeNotHeldException, system.InvalidProgramException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetAccessControl", path, fileSecurity == null ? null : fileSecurity.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetAttributes(java.lang.String path, FileAttributes fileAttributes) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.io.PathTooLongException, system.ArgumentOutOfRangeException, system.OutOfMemoryException, system.IndexOutOfRangeException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetAttributes", path, fileAttributes == null ? null : fileAttributes.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetCreationTime(java.lang.String path, DateTime creationTime) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.InvalidTimeZoneException, system.security.SecurityException, system.io.IOException, system.InvalidOperationException, system.NotSupportedException, system.OverflowException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NullReferenceException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetCreationTime", path, creationTime == null ? null : creationTime.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetCreationTimeUtc(java.lang.String path, DateTime creationTimeUtc) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.InvalidTimeZoneException, system.OverflowException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetCreationTimeUtc", path, creationTimeUtc == null ? null : creationTimeUtc.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetLastAccessTime(java.lang.String path, DateTime lastAccessTime) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.InvalidTimeZoneException, system.security.SecurityException, system.io.IOException, system.InvalidOperationException, system.NotSupportedException, system.OverflowException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NullReferenceException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetLastAccessTime", path, lastAccessTime == null ? null : lastAccessTime.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetLastAccessTimeUtc(java.lang.String path, DateTime lastAccessTimeUtc) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.InvalidTimeZoneException, system.OverflowException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetLastAccessTimeUtc", path, lastAccessTimeUtc == null ? null : lastAccessTimeUtc.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetLastWriteTime(java.lang.String path, DateTime lastWriteTime) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.InvalidTimeZoneException, system.security.SecurityException, system.io.IOException, system.InvalidOperationException, system.NotSupportedException, system.OverflowException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NullReferenceException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetLastWriteTime", path, lastWriteTime == null ? null : lastWriteTime.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void SetLastWriteTimeUtc(java.lang.String path, DateTime lastWriteTimeUtc) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.IndexOutOfRangeException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.io.IOException, system.InvalidTimeZoneException, system.OverflowException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("SetLastWriteTimeUtc", path, lastWriteTimeUtc == null ? null : lastWriteTimeUtc.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllBytes(java.lang.String path, byte[] bytes) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllBytes", path, bytes);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllBytes(java.lang.String dupParam0, JCORefOut dupParam1) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllBytes", dupParam0, dupParam1.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllLines(java.lang.String path, java.lang.String[] contents) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllLines", path, contents);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllLines(java.lang.String dupParam0, JCORefOut dupParam1) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllLines", dupParam0, dupParam1.getJCRefOut());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllLines(java.lang.String path, java.lang.String[] contents, Encoding encoding) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllLines", path, contents, encoding == null ? null : encoding.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllLines(java.lang.String dupParam0, JCORefOut dupParam1, Encoding dupParam2) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.io.PathTooLongException, system.globalization.CultureNotFoundException, system.NotSupportedException, system.InvalidOperationException, system.IndexOutOfRangeException, system.NullReferenceException, system.security.SecurityException, system.io.IOException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllLines", dupParam0, dupParam1.getJCRefOut(), dupParam2 == null ? null : dupParam2.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllText(java.lang.String path, java.lang.String contents) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllText", path, contents);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public static void WriteAllText(java.lang.String path, java.lang.String contents, Encoding encoding) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.FormatException, system.io.PathTooLongException, system.io.FileNotFoundException, system.io.DirectoryNotFoundException, system.UnauthorizedAccessException, system.io.IOException, system.io.DriveNotFoundException, system.OperationCanceledException, system.NotSupportedException, system.InvalidOperationException, system.NullReferenceException, system.security.SecurityException, system.IndexOutOfRangeException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
classType.Invoke("WriteAllText", path, contents, encoding == null ? null : encoding.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Properties section
// Instance Events section
}