declaration_list
{ "{"
field_declaration (+21 nodes collapsed)
field_declaration (+255 nodes collapsed)
field_declaration
modifier
private "private"
modifier
readonly "readonly"
variable_declaration
generic_name
identifier "ILogger"
type_argument_list
< "<"
identifier "ManagedFileSystem"
> ">"
variable_declarator
identifier "_logger"
; ";"
field_declaration
modifier
private "private"
modifier
readonly "readonly"
variable_declaration
generic_name
identifier "List"
type_argument_list
< "<"
identifier "IShortcutHandler"
> ">"
variable_declarator
identifier "_shortcutHandlers"
; ";"
field_declaration
modifier
private "private"
modifier
readonly "readonly"
variable_declaration
predefined_type "string"
variable_declarator
identifier "_tempPath"
; ";"
comment "/// <summary>"
comment "/// Initializes a new instance of the <see cref=\"ManagedFile"...
comment "/// </summary>"
comment "/// <param name=\"logger\">The <see cref=\"ILogger\"/> instance "...
comment "/// <param name=\"applicationPaths\">The <see cref=\"IApplicati"...
comment "/// <param name=\"shortcutHandlers\">the <see cref=\"IShortcutH"...
constructor_declaration (+59 nodes collapsed)
comment "/// <summary>"
comment "/// Determines whether the specified filename is shortcut."
comment "/// </summary>"
comment "/// <param name=\"filename\">The filename.</param>"
comment "/// <returns><c>true</c> if the specified filename is shortc"...
comment "/// <exception cref=\"ArgumentNullException\"><paramref name=\""...
method_declaration (+83 nodes collapsed)
comment "/// <summary>"
comment "/// Resolves the shortcut."
comment "/// </summary>"
comment "/// <param name=\"filename\">The filename.</param>"
comment "/// <returns>System.String.</returns>"
comment "/// <exception cref=\"ArgumentNullException\"><paramref name=\""...
method_declaration (+105 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+252 nodes collapsed)
comment "/// <summary>"
comment "/// Creates the shortcut."
comment "/// </summary>"
comment "/// <param name=\"shortcutPath\">The shortcut path.</param>"
comment "/// <param name=\"target\">The target.</param>"
comment "/// <exception cref=\"ArgumentNullException\">The shortcutPath"...
method_declaration (+146 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+173 nodes collapsed)
comment "/// <summary>"
comment "/// Returns a <see cref=\"FileSystemMetadata\"/> object for th"...
comment "/// </summary>"
comment "/// <param name=\"path\">A path to a file or directory.</param"...
comment "/// <returns>A <see cref=\"FileSystemMetadata\"/> object.</ret"...
comment "/// <remarks>If the specified path points to a directory, th"...
comment "/// <see cref=\"FileSystemMetadata.IsDirectory\"/> property wi"...
method_declaration (+146 nodes collapsed)
comment "/// <summary>"
comment "/// Returns a <see cref=\"FileSystemMetadata\"/> object for th"...
comment "/// </summary>"
comment "/// <param name=\"path\">A path to a file.</param>"
comment "/// <returns>A <see cref=\"FileSystemMetadata\"/> object.</ret"...
comment "/// <remarks><para>If the specified path points to a directo"...
comment "/// <see cref=\"FileSystemMetadata.IsDirectory\"/> property an"...
comment "/// <para>For automatic handling of files <b>and</b> directo"...
method_declaration (+42 nodes collapsed)
comment "/// <summary>"
comment "/// Returns a <see cref=\"FileSystemMetadata\"/> object for th"...
comment "/// </summary>"
comment "/// <param name=\"path\">A path to a directory.</param>"
comment "/// <returns>A <see cref=\"FileSystemMetadata\"/> object.</ret"...
comment "/// <remarks><para>If the specified path points to a file, t"...
comment "/// <see cref=\"FileSystemMetadata.IsDirectory\"/> property wi"...
comment "/// <para>For automatic handling of files <b>and</b> directo"...
method_declaration (+42 nodes collapsed)
method_declaration
modifier
private "private"
identifier "FileSystemMetadata"
identifier "GetFileSystemMetadata"
parameter_list
( "("
parameter
identifier "FileSystemInfo"
identifier "info"
) ")"
block
{ "{"
local_declaration_statement (+45 nodes collapsed)
if_statement
if "if"
( "("
member_access_expression
identifier "result"
. "."
identifier "Exists"
) ")"
block
{ "{"
expression_statement (+34 nodes collapsed)
comment "// if (!result.IsDirectory)"
comment "// {"
comment "// result.IsHidden = (info.Attributes & FileAttributes.Hi"...
comment "// }"
if_statement
if "if"
( "("
is_pattern_expression
identifier "info"
is "is"
declaration_pattern
identifier "FileInfo"
identifier "fileInfo"
) ")"
block
{ "{"
expression_statement
assignment_expression
member_access_expression
identifier "result"
. "."
identifier "Length"
= "="
member_access_expression
identifier "fileInfo"
. "."
identifier "Length"
; ";"
comment "// Issue #2354 get the size of files behind symbolic links. "...
if_statement
if "if"
( "("
binary_expression
parenthesized_expression
( "("
binary_expression
member_access_expression
identifier "fileInfo"
. "."
identifier "Attributes"
& "&"
member_access_expression
identifier "FileAttributes"
. "."
identifier "ReparsePoint"
) ")"
== "=="
member_access_expression
identifier "FileAttributes"
. "."
identifier "ReparsePoint"
) ")"
block
{ "{"
try_statement
try "try"
block
{ "{"
using_statement
using "using"
( "("
variable_declaration
implicit_type
var "var"
variable_declarator
identifier "fileHandle"
= "="
invocation_expression
member_access_expression
identifier "File"
. "."
identifier "OpenHandle"
argument_list
( "("
argument
member_access_expression
identifier "fileInfo"
. "."
identifier "FullName"
, ","
argument
member_access_expression
identifier "FileMode"
. "."
identifier "Open"
, ","
argument
member_access_expression
identifier "FileAccess"
. "."
identifier "Read"
, ","
argument
member_access_expression
identifier "FileShare"
. "."
identifier "ReadWrite"
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
member_access_expression
identifier "result"
. "."
identifier "Length"
= "="
invocation_expression
member_access_expression
identifier "RandomAccess"
. "."
identifier "GetLength"
argument_list
( "("
argument
identifier "fileHandle"
) ")"
; ";"
} "}"
} "}"
catch_clause
catch "catch"
catch_declaration
( "("
identifier "FileNotFoundException"
identifier "ex"
) ")"
block
{ "{"
comment "// Dangling symlinks cannot be detected before opening the f"...
expression_statement
invocation_expression
member_access_expression
identifier "_logger"
. "."
identifier "LogError"
argument_list
( "("
argument
identifier "ex"
, ","
argument
string_literal
" "\""
string_literal_content "Reading the file size of the symlink at {Path} failed. Marki"...
" "\""
, ","
argument
member_access_expression
identifier "fileInfo"
. "."
identifier "FullName"
) ")"
; ";"
expression_statement all 2:1
assignment_expression all 2:1
member_access_expression all 2:1
identifier "result" all 2:1
. "." all 2:1
identifier "Exists" all 2:1
= "=" all 2:1
boolean_literal all 2:1
false "false" all 2:1
; ";" all 2:1
} "}"
catch_clause (+34 nodes collapsed)
catch_clause
catch "catch"
catch_declaration
( "("
identifier "IOException"
identifier "ex"
) ")"
block
{ "{"
comment "// IOException generally means the file is not accessible du"...
comment "// Catch this exception and mark the file as not exist to ig"...
expression_statement
invocation_expression
member_access_expression
identifier "_logger"
. "."
identifier "LogError"
argument_list
( "("
argument
identifier "ex"
, ","
argument
string_literal
" "\""
string_literal_content "Reading the file at {Path} failed due to an IO Exception. Ma"...
" "\""
, ","
argument
member_access_expression
identifier "fileInfo"
. "."
identifier "FullName"
) ")"
; ";"
expression_statement all 2:1
assignment_expression all 2:1
member_access_expression all 2:1
identifier "result" all 2:1
. "." all 2:1
identifier "Exists" all 2:1
= "=" all 2:1
boolean_literal all 2:1
false "false" all 2:1
; ";" all 2:1
} "}"
} "}"
} "}"
expression_statement
assignment_expression
member_access_expression
identifier "result"
. "."
identifier "CreationTimeUtc"
= "="
invocation_expression
identifier "GetCreationTimeUtc"
argument_list
( "("
argument
identifier "info"
) ")"
; ";"
expression_statement
assignment_expression
member_access_expression
identifier "result"
. "."
identifier "LastWriteTimeUtc"
= "="
invocation_expression
identifier "GetLastWriteTimeUtc"
argument_list
( "("
argument
identifier "info"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
assignment_expression
member_access_expression
identifier "result"
. "."
identifier "IsDirectory"
= "="
is_pattern_expression
identifier "info"
is "is"
constant_pattern
identifier "DirectoryInfo"
; ";"
} "}"
return_statement
return "return"
identifier "result"
; ";"
} "}"
comment "/// <summary>"
comment "/// Takes a filename and removes invalid characters."
comment "/// </summary>"
comment "/// <param name=\"filename\">The filename.</param>"
comment "/// <returns>System.String.</returns>"
comment "/// <exception cref=\"ArgumentNullException\">The filename is "...
method_declaration (+220 nodes collapsed)
comment "/// <summary>"
comment "/// Gets the creation time UTC."
comment "/// </summary>"
comment "/// <param name=\"info\">The info.</param>"
comment "/// <returns>DateTime.</returns>"
method_declaration (+68 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+32 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+23 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+23 nodes collapsed)
comment "/// <summary>"
comment "/// Gets the creation time UTC."
comment "/// </summary>"
comment "/// <param name=\"info\">The info.</param>"
comment "/// <returns>DateTime.</returns>"
method_declaration (+68 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+32 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+153 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+223 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+186 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+86 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+65 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+50 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+75 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+45 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+135 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+66 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+47 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+55 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+65 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+301 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+87 nodes collapsed)
method_declaration (+37 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+56 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+48 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+256 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+125 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+29 nodes collapsed)
comment "/// <inheritdoc />"
method_declaration (+29 nodes collapsed)
method_declaration (+39 nodes collapsed)
} "}"