FileHelper Class

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Helper class for handling file and folder tasks.

public static class FileHelper
Inheritance:
System.Object → FileHelper

Methods

CreateCollage(IEnumerableInfo>, Int32, Int32, FitMode, ScaleMode, ContentAlignment, Nullable, Int32, Int32, Boolean) Creates a collage from the specified images.
DimensionsAsString(Nullable) Returns the dimensions of an image as a string, e.g. 800x600.
EnsureDirectoryExists(DirectoryInfo) Makes sure the directory exists.
EnsureDirectoryExists(FileInfo) Makes sure the parent directory of the file exists.
ETag(FileInfo) Returns the ETag for the specified file.
FileSizeAsString(Int64) Returns the file size as a string, e.g. 2 GB instead of 2147483647.
FileSizeAsString(Nullable) Returns the file size as a string, e.g. 2 GB instead of 2147483647.
GetAppIcon(out String) Gets the app icon.
GetAvatar(EntityType) Gets the avatar image for the specified entity.
GetExtension(String) Gets the extension, including the ".", of the specified path string (in lowercase).
GetFileNameWithoutExtension(String) Returns the file name of the specified path string without the extension.
GetIcon(String) Returns the icon to use for the specified filename.
GetImageExtension(String) Returns the default extension for common image mime types.
GetImageMetadata(FileInfo) Gets metadata for the specified image file.
GetKind(String) Returns the kind of a file, e.g. "image", "document", "video" etc.
GetPreviewFormat(String) Returns the file extension used when previewing a file.
GetRelativePath(String, String) Get the relative path from one file or folder to another.
GetTempDir(Boolean) Returns a temporary directory, i.e. App_Data\Temp
GetTempFile(String, String) Returns a new temporary file, e.g. App_Data\Temp\c386dfed-9c79-42a6-bfe1-5d740cc2a934.txt
IsAnimation(String) Returns whether the specified filename is considered an animated image.
IsAudio(String) Returns whether the specified filename is considered audio.
IsBitmap(String) Returns whether the specified filename is considered a bitmap image.
IsFileToLarge(Int64) Returns a value indicating if the file is larger than MaxUploadSize.
IsIcon(File) See if the image considered to be an icon.
IsImage(String) Returns whether the specified filename is considered an image.
IsMarkup(String) Returns whether the specified filename is considered markup (html or xml).
IsMedia(String) Returns whether the specified filename is considered media (audio, video or image).
IsOfficeDocument(String) Returns whether the specified filename is a Office document format.
IsPlainText(String) Returns whether the specified filename is considered plain text.
IsSmallIcon(File) See if the image considered to be a small icon.
IsText(String) Returns whether the specified filename is considered text.
IsWebImage(String) Returns whether the file at the specified path is considered a web image (bmp, gif, ico, jpg, png or svg).
IsVectorImage(String) Returns whether the specified filename is considered a vector image.
IsVideo(String) Returns whether the specified filename is considered video.
Ratio(Blob) Get the width/height ratio of an image.
RatioFlex(Double, Double, Double, Boolean) Get the flex properties to resize/scale based on the ratio.
Resize(FileInfo, Nullable, Nullable, FitMode, ScaleMode, ContentAlignment, Nullable, Int32, Int32, Boolean, String) Returns a resized version of the specified image.
SafeName(String, String) Replaces invalid file name chars from the specified filename.
SyntaxHighlight(String) Returns the language code used for syntax highlighting the specified file.
TransferSpeedAsString(Int64, Int64) Returns the transfer speed as a string, e.g. 5 Mbit/s, given the bytes transferred and the total transfer time.